diff --git a/source/code/BlockGame.cpp b/source/code/BlockGame.cpp index 4a9c3a0..dd307af 100644 --- a/source/code/BlockGame.cpp +++ b/source/code/BlockGame.cpp @@ -457,13 +457,11 @@ void BlockGame::putStartBlocks() { } void BlockGame::putStartBlocks(Uint32 n) { -#if DEBUG - cout << n << ":" << f.str() << endl; -#endif - for (int i=0; i<7; i++) + for (int i=0; i<7; i++) { for (int j=0; j<30; j++) { board[i][j] = -1; } + } nextRandomNumber = n; int choice = rand2()%3; //Pick a random layout switch (choice) { diff --git a/source/code/CppSdlImageHolder.cpp b/source/code/CppSdlImageHolder.cpp index ad1c3be..b571449 100644 --- a/source/code/CppSdlImageHolder.cpp +++ b/source/code/CppSdlImageHolder.cpp @@ -89,7 +89,7 @@ void CppSdlImageHolder::PaintTo(SDL_Surface* target, int x, int y) { } dest.x = x; dest.y = y; - SDL_BlitSurface(data,&area, target,&dest); + SDL_BlitSurface(data, &area, target,&dest); } void CppSdlImageHolder::OptimizeForBlit(bool allowAlpha) { diff --git a/source/code/main.cpp b/source/code/main.cpp index 7e11d07..09a0dba 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp @@ -34,7 +34,7 @@ http://blockattack.sf.net //If DEBUG is defined: AI info and FPS will be written to screen #ifndef DEBUG -#define DEBUG 0 +#define DEBUG 1 #endif #define WITH_SDL 1 @@ -780,14 +780,10 @@ class ballManeger { public: aBall ballArray[maxNumberOfBalls]; bool ballUsed[maxNumberOfBalls]; - //The old ball information is also saved so balls can be deleted! - aBall oldBallArray[maxNumberOfBalls]; - bool oldBallUsed[maxNumberOfBalls]; ballManeger() { for (int i=0; i800 || ballArray[i].getX()>xsize || ballArray[i].getX()<-ballSize) { ballUsed[i] = false; } } - else { - oldBallUsed[i] = false; - } } } //update @@ -878,14 +869,10 @@ class explosionManeger { public: anExplosion explosionArray[maxNumberOfBalls]; bool explosionUsed[maxNumberOfBalls]; - //The old explosion information is also saved so explosions can be deleted! - anExplosion oldExplosionArray[maxNumberOfBalls]; - bool oldExplosionUsed[maxNumberOfBalls]; explosionManeger() { for (int i=0; isBoard,screen,theGame->GetTopX(),theGame->GetTopY()); string strHolder; strHolder = itoa(theGame->GetScore()+theGame->GetHandicap()); @@ -2011,7 +1949,7 @@ void DrawEverything(int xsize, int ysize,BlockGameSdl* theGame, BlockGameSdl* th } //NFont_Write(screen, 800,4,FPS); - nf_standard_blue_font.draw(800,4,FPS); + nf_standard_blue_font.draw(800, 4, "%s", FPS); #endif //SDL_Flip(screen); Update screen is now called outside DrawEvrything, bacause the mouse needs to be painted @@ -2384,7 +2322,7 @@ void startVsMenu() { //DrawIMG(mouse,screen,mousex,mousey); mouse->PaintTo(screen,mousex,mousey); SDL_Flip(screen); //draws it all to the screen - SDL_Delay(10); + SDL_Delay(1); } while (!done && !Config::getInstance()->isShuttingDown()); @@ -2550,12 +2488,9 @@ int main(int argc, char* argv[]) { textdomain (PACKAGE); if (argc > 1) { int argumentNr = 1; - forceredraw = 2; while (argc>argumentNr) { const char helpString[] = "--help"; const char priorityString[] = "-priority"; - const char forceRedrawString[] = "-forceredraw"; - const char forcepartdrawString[] = "-forcepartdraw"; const char singlePuzzleString[] = "-SP"; const char noSoundAtAll[] = "-nosound"; const char selectTheme[] = "-theme"; @@ -2563,8 +2498,6 @@ int main(int argc, char* argv[]) { if (strequals(argv[argumentNr],helpString)) { cout << "Block Attack Help" << endl << helpString << " " << _("Displays this message") << endl << "-priority " << _("Starts game in high priority") << endl << - "-forceredraw " << _("Redraw the whole screen every frame, prevents garbage") << endl << - "-forcepartdraw " << _("Only draw what is changed, sometimes cause garbage") << endl << "-nosound " << _("No sound will be played at all, and sound hardware will not be loaded (use this if game crashes because of sound)") << endl << "-theme <" << _("THEMENAME") << "> " << _("Changes to the theme on startup") << endl; #ifdef WIN32 @@ -2578,12 +2511,6 @@ int main(int argc, char* argv[]) { } highPriority = true; } - if (strequals(argv[argumentNr],forceRedrawString)) { - forceredraw = 1; - } - if (strequals(argv[argumentNr],forcepartdrawString)) { - forceredraw = 2; - } if (strequals(argv[argumentNr],singlePuzzleString)) { singlePuzzle = true; //We will just have one puzzle if (argv[argumentNr+1][1]!=0) { @@ -3067,7 +2994,7 @@ int runGame(int gametype, int level) { } if (!(highPriority)) { - SDL_Delay(10); + SDL_Delay(1); } if ((standardBackground)&&(!editorMode)) { diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index f0ad0c9..c3f390a 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp @@ -215,7 +215,7 @@ static int oldMousex, oldMousey; static int oldBubleX, oldBubleY; //bool doublebuf = false; //if true, screen is double buffered -static char forceredraw; //If 1: always redraw, if 2: rarely redraw +static char forceredraw = 1; //If 1: always redraw, if 2: rarely redraw static bool singlePuzzle = false; //if true we are just in a little 300x600 window static int singlePuzzleNr = 0;