Browse Source

Strip out debug features from the release builds

leveldebug and lightmax still remains
pull/1024/head
Anders Jenbo 5 years ago
parent
commit
327042c2e5
  1. 2
      Source/all.h
  2. 2
      Source/debug.cpp
  3. 4
      Source/debug.h
  4. 6
      Source/diablo.cpp
  5. 2
      Source/diablo.h
  6. 13
      Source/gendung.cpp
  7. 2
      Source/lighting.cpp
  8. 2
      Source/monster.cpp

2
Source/all.h

@ -25,7 +25,9 @@
#include "control.h" #include "control.h"
#include "cursor.h" #include "cursor.h"
#include "dead.h" #include "dead.h"
#ifdef _DEBUG
#include "debug.h" #include "debug.h"
#endif
#include "diablo.h" #include "diablo.h"
#include "doom.h" #include "doom.h"
#include "drlg_l1.h" #include "drlg_l1.h"

2
Source/debug.cpp

@ -9,7 +9,6 @@ DEVILUTION_BEGIN_NAMESPACE
#ifdef _DEBUG #ifdef _DEBUG
BOOL update_seed_check = FALSE; BOOL update_seed_check = FALSE;
#endif
#define DEBUGSEEDS 4096 #define DEBUGSEEDS 4096
int seed_index; int seed_index;
@ -48,7 +47,6 @@ void CheckDungeonClear()
} }
} }
#ifdef _DEBUG
void GiveGoldCheat() void GiveGoldCheat()
{ {
int i, ni; int i, ni;

4
Source/debug.h

@ -14,10 +14,9 @@ extern "C" {
extern BYTE *pSquareCel; extern BYTE *pSquareCel;
void LoadDebugGFX();
void FreeDebugGFX(); void FreeDebugGFX();
void CheckDungeonClear(); void CheckDungeonClear();
#ifdef _DEBUG void LoadDebugGFX();
void GiveGoldCheat(); void GiveGoldCheat();
void TakeGoldCheat(); void TakeGoldCheat();
void MaxSpellsCheat(); void MaxSpellsCheat();
@ -26,7 +25,6 @@ void PrintDebugPlayer(BOOL bNextPlayer);
void PrintDebugQuest(); void PrintDebugQuest();
void GetDebugMonster(); void GetDebugMonster();
void NextDebugMonster(); void NextDebugMonster();
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

6
Source/diablo.cpp

@ -57,12 +57,12 @@ Options sgOptions;
*/ */
BOOL fullscreen = TRUE; BOOL fullscreen = TRUE;
bool gbShowIntro = true; bool gbShowIntro = true;
BOOL leveldebug;
#ifdef _DEBUG #ifdef _DEBUG
BOOL monstdebug; BOOL monstdebug;
int DebugMonsters[10]; int DebugMonsters[10];
int debugmonsttypes; int debugmonsttypes;
BOOL visiondebug; BOOL visiondebug;
BOOL leveldebug;
int questdebug = -1; int questdebug = -1;
int debug_mode_key_s; int debug_mode_key_s;
int debug_mode_key_w; int debug_mode_key_w;
@ -241,7 +241,9 @@ static void start_game(unsigned int uMsg)
cineflag = FALSE; cineflag = FALSE;
InitCursor(); InitCursor();
InitLightTable(); InitLightTable();
#ifdef _DEBUG
LoadDebugGFX(); LoadDebugGFX();
#endif
assert(ghMainWnd); assert(ghMainWnd);
music_stop(); music_stop();
ShowProgress(uMsg); ShowProgress(uMsg);
@ -268,7 +270,9 @@ static void free_game()
FreeItemGFX(); FreeItemGFX();
FreeCursor(); FreeCursor();
FreeLightTable(); FreeLightTable();
#ifdef _DEBUG
FreeDebugGFX(); FreeDebugGFX();
#endif
FreeGameMem(); FreeGameMem();
} }

2
Source/diablo.h

@ -62,12 +62,12 @@ void LoadOptions();
/* rdata */ /* rdata */
extern BOOL fullscreen; extern BOOL fullscreen;
extern BOOL leveldebug;
#ifdef _DEBUG #ifdef _DEBUG
extern BOOL monstdebug; extern BOOL monstdebug;
extern int debugmonsttypes; extern int debugmonsttypes;
extern int DebugMonsters[10]; extern int DebugMonsters[10];
extern BOOL visiondebug; extern BOOL visiondebug;
extern BOOL leveldebug;
extern int questdebug; extern int questdebug;
extern int debug_mode_key_w; extern int debug_mode_key_w;
extern int debug_mode_key_inverted_v; extern int debug_mode_key_inverted_v;

13
Source/gendung.cpp

@ -592,11 +592,14 @@ BOOL SkipThemeRoom(int x, int y)
void InitLevels() void InitLevels()
{ {
if (!leveldebug) { #ifdef _DEBUG
currlevel = 0; if (leveldebug)
leveltype = DTYPE_TOWN; return;
setlevel = FALSE; #endif
}
currlevel = 0;
leveltype = DTYPE_TOWN;
setlevel = FALSE;
} }
DEVILUTION_END_NAMESPACE DEVILUTION_END_NAMESPACE

2
Source/lighting.cpp

@ -14,9 +14,7 @@ int numlights;
BYTE lightradius[16][128]; BYTE lightradius[16][128];
BOOL dovision; BOOL dovision;
int numvision; int numvision;
#ifdef _DEBUG
char lightmax; char lightmax;
#endif
BOOL dolighting; BOOL dolighting;
BYTE lightblock[64][16][16]; BYTE lightblock[64][16][16];
int visionid; int visionid;

2
Source/monster.cpp

@ -1106,8 +1106,10 @@ void InitMonsters()
int scattertypes[NUM_MTYPES]; int scattertypes[NUM_MTYPES];
numscattypes = 0; numscattypes = 0;
#ifdef _DEBUG
if (gbIsMultiplayer) if (gbIsMultiplayer)
CheckDungeonClear(); CheckDungeonClear();
#endif
if (!setlevel) { if (!setlevel) {
AddMonster(1, 0, 0, 0, FALSE); AddMonster(1, 0, 0, 0, FALSE);
AddMonster(1, 0, 0, 0, FALSE); AddMonster(1, 0, 0, 0, FALSE);

Loading…
Cancel
Save