From ca198d08bfb383ff7c5de9d7c897861f80e60abb Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 31 Dec 2010 18:07:07 +0000 Subject: [PATCH] win32: allow debug console showage to be overridden with ini file [Display] Show Console=1 --- desmume/src/windows/console.cpp | 7 ------- desmume/src/windows/main.cpp | 14 +++++++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/desmume/src/windows/console.cpp b/desmume/src/windows/console.cpp index 6d2b0fc95..d54a82bee 100644 --- a/desmume/src/windows/console.cpp +++ b/desmume/src/windows/console.cpp @@ -25,7 +25,6 @@ ///////////////////////////////////////////////////////////////// Console -#if !defined(PUBLIC_RELEASE) || defined(DEVELOPER) #define BUFFER_SIZE 100 HANDLE hConsole = NULL; void printlog(const char *fmt, ...); @@ -117,9 +116,3 @@ void printlog(const char *fmt, ...) va_end(list); WriteConsole(hConsole,msg, (DWORD)strlen(msg), &tmp, 0); } -#else - -void OpenConsole() {} -void CloseConsole() {} - -#endif diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 9c26d6e90..6bbe5d28d 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2556,8 +2556,6 @@ int _main() char text[80]; - GetINIPath(); - path.ReadPathSettings(); CommonSettings.cheatsDisable = GetPrivateProfileBool("General", "cheatsDisable", false, IniName); @@ -3051,7 +3049,17 @@ int WINAPI WinMain (HINSTANCE hThisInstance, g_thread_init (NULL); hAppInst=hThisInstance; - OpenConsole(); // Init debug console + + GetINIPath(); + + #if !defined(PUBLIC_RELEASE) || defined(DEVELOPER) + static const bool defaultConsoleEnable = true; + #else + static const bool defaultConsoleEnable = false; + #endif + + if(GetPrivateProfileBool("Display", "Show Console", defaultConsoleEnable, IniName)) + OpenConsole(); // Init debug console int ret = _main();