From 3ab8206245b6a840a0f9f6101dc54540571cde2e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 29 Jun 2010 00:03:15 +0200 Subject: [PATCH] Use DEBUG instead of USEPAK to enable debugging code. eapplication of commit bcd19efa602b9279399b17e7756b8212df0fa234. --- src/CEngine.cpp | 5 ----- src/defs.h | 6 +++--- src/game.cpp | 8 +++----- src/hub.cpp | 4 ++-- src/info.cpp | 4 ++-- src/lineDefs.cpp | 2 +- src/main.cpp | 2 +- src/map.cpp | 2 +- src/player.cpp | 2 +- 9 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/CEngine.cpp b/src/CEngine.cpp index a84d257..37238ae 100644 --- a/src/CEngine.cpp +++ b/src/CEngine.cpp @@ -84,11 +84,6 @@ Engine::Engine() // Cheats memset(lastKeyEvents, ' ', 25); - #if USEPAK - cheats = false; - #else - cheats = true; - #endif cheatHealth = cheatExtras = cheatFuel = cheatLevels = false; cheatBlood = cheatInvulnerable = cheatReload = cheatSpeed = cheatSkipLevel = false; diff --git a/src/defs.h b/src/defs.h index a18a110..d4e588d 100755 --- a/src/defs.h +++ b/src/defs.h @@ -377,10 +377,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 8257e20..5deea33 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -571,7 +571,7 @@ int doGame() Uint32 then, frames, frameLimit, millis, frameCounter; - #if !USEPAK + #if DEBUG Uint32 now; char fps[10]; strncpy(fps, "fps", sizeof fps); @@ -587,12 +587,10 @@ int doGame() { player.health = -99; - //#if USEPAK if ((!map.isBossMission) && (replayData.replayMode == REPLAY_MODE::NONE)) { showMissionInformation(); } - //#endif game.levelsStarted++; } @@ -814,7 +812,7 @@ int doGame() engine.setInfoMessage("Skipping Mission...", 2, INFO_OBJECTIVE); } - #if !USEPAK + #if DEBUG if (engine.keyState[SDLK_F1]) { autoCompleteAllObjectives(false); @@ -841,7 +839,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 ce53472..3f4ecc9 100644 --- a/src/hub.cpp +++ b/src/hub.cpp @@ -494,7 +494,7 @@ int doHub() char name[50], level[50], requiredLevel[50]; int x, y; - #if !USEPAK + #if DEBUG char pos[50]; #endif @@ -613,7 +613,7 @@ int doHub() graphics.drawRect(10, 430, 620, 40, graphics.black, graphics.white, graphics.screen); - #if !USEPAK + #if DEBUG snprintf(pos, sizeof 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 8ddcc66..0ccb061 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -213,10 +213,10 @@ void doPauseInfo() graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00); - //#if !USEPAK + #if DEBUG snprintf(string, sizeof string, _("Position = %d:%d"), (int)player.x, (int)player.y); graphics.drawString(string, 5, 25, false, graphics.screen); - //#endif + #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 33838ac..231f643 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 eb86f17..0360b61 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 6b7eb29..77661d8 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -429,7 +429,7 @@ void doPlayer() } } - #if !USEPAK + #if DEBUG if (engine.keyState[SDLK_1]) player.currentWeapon = &weapon[WP_PISTOL]; else if (engine.keyState[SDLK_2]) -- 2.39.5