Skip to content

Commit

Permalink
Handle debug mode
Browse files Browse the repository at this point in the history
Closes #298
  • Loading branch information
alexbatalov committed Jul 19, 2023
1 parent 90d1545 commit 3a17818
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include "trait.h"
#include "version.h"
#include "window_manager.h"
#include "window_manager_private.h"
#include "worldmap.h"

namespace fallout {
Expand Down Expand Up @@ -168,6 +169,20 @@ int gameInitWithOptions(const char* windowTitle, bool isMapper, int font, int a4
showSplash();
}

// CE: Handle debug mode (exactly as seen in `mapper2.exe`).
const char* debugMode = settings.debug.mode.c_str();
if (compat_stricmp(debugMode, "environment") == 0) {
_debug_register_env();
} else if (compat_stricmp(debugMode, "screen") == 0) {
_debug_register_screen();
} else if (compat_stricmp(debugMode, "log") == 0) {
_debug_register_log("debug.log", "wt");
} else if (compat_stricmp(debugMode, "mono") == 0) {
_debug_register_mono();
} else if (compat_stricmp(debugMode, "gnw") == 0) {
_debug_register_func(_win_debug);
}

interfaceFontsInit();
fontManagerAdd(&gModernFontManager);
fontSetCurrent(font);
Expand Down

0 comments on commit 3a17818

Please sign in to comment.