From: Guus Sliepen Date: Wed, 23 Dec 2009 13:22:50 +0000 (+0100) Subject: Use DEBUG instead of USEPAK to enable debugging code. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bcd19efa602b9279399b17e7756b8212df0fa234;p=quix0rs-blobwars.git Use DEBUG instead of USEPAK to enable debugging code. --- diff --git a/src/CEngine.cpp b/src/CEngine.cpp index deb3cb4..57105a2 100644 --- a/src/CEngine.cpp +++ b/src/CEngine.cpp @@ -84,12 +84,6 @@ Engine::Engine() // Cheats memset(lastKeyEvents, ' ', 25); - #if USEPAK - cheats = false; - #else - cheats = true; - cheats = false; - #endif cheatHealth = cheatExtras = cheatFuel = cheatLevels = false; cheatBlood = cheatInvulnerable = cheatReload = cheatSpeed = cheatSkipLevel = false; diff --git a/src/defs.h b/src/defs.h index c245ca7..1758ffb 100644 --- a/src/defs.h +++ b/src/defs.h @@ -371,10 +371,10 @@ enum { /* ############# debug ################## */ -#if USEPAK - #define debug(x) {} -#else +#if DEBUG #define debug(x) {printf("*** DEBUG: "); printf x;} +#else + #define debug(x) {} #endif #ifndef IGNORE_FLAGTOKEN_ERRORS diff --git a/src/game.cpp b/src/game.cpp index 42894ee..8fa42b2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -568,7 +568,7 @@ int doGame() Uint32 then, frames, frameLimit, millis, frameCounter; - #if !USEPAK + #if DEBUG Uint32 now; char fps[10]; strcpy(fps, "fps"); @@ -584,12 +584,10 @@ int doGame() { player.health = -99; - //#if USEPAK if ((!map.isBossMission) && (replayData.replayMode == REPLAY_MODE::NONE)) { showMissionInformation(); } - //#endif game.levelsStarted++; } @@ -810,7 +808,7 @@ int doGame() engine.setInfoMessage("Skipping Mission...", 2, INFO_OBJECTIVE); } - #if !USEPAK + #if DEBUG if (engine.keyState[SDLK_F1]) { autoCompleteAllObjectives(false); @@ -837,7 +835,7 @@ int doGame() if (game.missionOverReason == MIS_GAMECOMPLETE) frameLimit = SDL_GetTicks() + 64; - #if !USEPAK + #if DEBUG graphics.drawString(fps, 600, 30, true, graphics.screen); if (SDL_GetTicks() > frameCounter + 500) diff --git a/src/hub.cpp b/src/hub.cpp index 1cba4a7..6e34265 100644 --- a/src/hub.cpp +++ b/src/hub.cpp @@ -491,7 +491,7 @@ int doHub() char name[50], level[50], requiredLevel[50]; int x, y; - #if !USEPAK + #if DEBUG char pos[50]; #endif @@ -609,7 +609,7 @@ int doHub() graphics.drawRect(10, 430, 620, 40, graphics.black, graphics.white, graphics.screen); - #if !USEPAK + #if DEBUG sprintf(pos, "%.3d:%.3d", engine.getMouseX(), engine.getMouseY()); graphics.drawString(pos, 320, 15, true, graphics.screen); #endif diff --git a/src/info.cpp b/src/info.cpp index 6945f46..cdf365c 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -213,10 +213,8 @@ void doPauseInfo() graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00); - //#if !USEPAK sprintf(string, _("Position = %d:%d"), (int)player.x, (int)player.y); graphics.drawString(string, 5, 25, false, graphics.screen); - //#endif graphics.drawString(_("*** PAUSED ***"), 320, y, TXT_CENTERED, graphics.screen); diff --git a/src/lineDefs.cpp b/src/lineDefs.cpp index 81c5f48..ee55f84 100644 --- a/src/lineDefs.cpp +++ b/src/lineDefs.cpp @@ -64,7 +64,7 @@ void doLineDefs() if ((absX < 800) && (absY < 600)) { - #if !USEPAK + #if DEBUG graphics.drawRect(x, y, lineDef->width, lineDef->height, graphics.red, graphics.screen); #endif diff --git a/src/main.cpp b/src/main.cpp index 3cbe77f..00bdcf9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) else if (strcmp(argv[i], "-map") == 0) {game.setMapName(argv[++i]); requiredSection = SECTION_GAME;} else if (strcmp(argv[i], "-listmaps") == 0) listMaps(); - #if !USEPAK + #if DEBUG else if (strcmp(argv[i], "-showsprites") == 0) showSprites = true; else if (strcmp(argv[i], "-hub") == 0) hub = true; else if (strcmp(argv[i], "-randomscreens") == 0) graphics.takeRandomScreenShots = true; diff --git a/src/map.cpp b/src/map.cpp index e7083c8..70279d9 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -51,7 +51,7 @@ void drawMap() { graphics.blit(graphics.tile[brick], r.x, r.y, graphics.screen, false); - #if !USEPAK + #if DEBUG if ((brick >= MAP_NORESET) && (brick < MAP_DECORATION)) { graphics.drawRect(r.x, r.y, 32, 4, graphics.yellow, graphics.screen); diff --git a/src/player.cpp b/src/player.cpp index bb0c202..ac33957 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -352,7 +352,7 @@ void doPlayer() } } - #if !USEPAK + #if DEBUG if (engine.keyState[SDLK_1]) player.currentWeapon = &weapon[WP_PISTOL]; else if (engine.keyState[SDLK_2])