From 26200179711ba8a4faa41ae77b85a808d46255f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Sun, 11 Dec 2016 01:18:17 +0700 Subject: [PATCH] Reading debug mode from config again, but command line option overrides it --- Source/Settings.cpp | 3 +++ Source/main.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Settings.cpp b/Source/Settings.cpp index 97cdbb2..fe6c37b 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -52,6 +52,7 @@ void DefaultSettings() velocityblur = 0; volume = 0.8f; ambientsound = 1; + debugmode = 0; crouchkey = SDL_SCANCODE_LSHIFT; jumpkey = SDL_SCANCODE_SPACE; @@ -241,6 +242,8 @@ bool LoadSettings() ipstream >> damageeffects; } else if ( !strncmp(setting, "Text", 4) ) { ipstream >> texttoggle; + } else if ( !strncmp(setting, "Debug", 5) ) { + ipstream >> debugmode; } else if ( !strncmp(setting, "Show Points", 11) ) { ipstream >> showpoints; } else if ( !strncmp(setting, "Always Blur", 11) ) { diff --git a/Source/main.cpp b/Source/main.cpp index 2803226..10f2459 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -617,8 +617,6 @@ int main(int argc, char **argv) return 1; } - debugmode = commandLineOptions[DEBUG]; - // !!! FIXME: we could use a Win32 API for this. --ryan. #ifndef WIN32 chdirToAppPath(argv[0]); @@ -637,6 +635,10 @@ int main(int argc, char **argv) return 42; } + if (commandLineOptions[DEBUG]) { + debugmode = true; + } + bool gameDone = false; bool gameFocused = true; -- 2.39.2