From 3a17818ceb7dafb3ec3ffc9ac3c2a906d823fa5c Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 19 Jul 2023 11:51:13 +0300 Subject: [PATCH] Handle debug mode Closes #298 --- src/game.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/game.cc b/src/game.cc index abe6613..648e501 100644 --- a/src/game.cc +++ b/src/game.cc @@ -65,6 +65,7 @@ #include "trait.h" #include "version.h" #include "window_manager.h" +#include "window_manager_private.h" #include "worldmap.h" namespace fallout { @@ -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);