/*************************************************************************** begin : Fri May 19 2000 copyright : (C) 2000 by Roman Merzlyakov email : roman@sbrf.barrt.ru copyright : (C) 2000 by Roman Razilov email : Roman.Razilov@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include //#include "shotcounter.h" #include #include "linesboard.h" //#include #include #include #include #include #include "prefs.h" #define PIXSIZE (CELLSIZE - 2) int colorLinesArr[NCOLORS] = {0x0000ff, 0x00ff00, 0xff0000, 0x00ffff, 0xff00ff, 0xffff00, 0x005080}; // 0x00bbggrr // red , green , blue , yellow , violet , cyan , brown BallPainter::BallPainter() : TQObject(), backgroundPix(0) { createPix(); } BallPainter::~BallPainter() { deletePix(); } void BallPainter::deletePix() { delete backgroundPix; for(int c=0; cisNull() ||backgroundPix->isNull() || fire->isNull() ) { KMessageBox::error(0, i18n("Unable to find graphics. Check your installation."), i18n("Error")); tqApp->exit(1); return; // Error } for(int c=0; c=NCOLORS) || (animstep<0) || color == NOBALL ){ return *backgroundPix; } if ( panim == ANIM_JUMP ) { if ( ( animstep < 0 ) || ( animstep >= PIXTIME ) ) return *backgroundPix; else return *imgCash[color][animstep]; } else if ( panim == ANIM_BURN ) { if ( animstep < FIREBALLS ) return *imgCash[color][animstep + PIXTIME + BOOMBALLS + 1]; else if ( animstep < FIREBALLS + FIREPIX ) return *firePix[animstep - FIREBALLS]; } else if ( panim == ANIM_BORN ) { if ( animstep < BOOMBALLS ) return *imgCash[color][animstep + PIXTIME]; else return *imgCash[color][NORMALBALL]; } // rest is not imlemented yet return *imgCash[color][NORMALBALL]; } #include "ballpainter.moc"