From ecffa492f698b5163a8cdee84f77c54cdb4c15ff Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 22 Dec 2012 09:54:07 -0800 Subject: [PATCH] Refactor Windows show log switch. --- Windows/main.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Windows/main.cpp b/Windows/main.cpp index b4131d81d9..d2f9b186ac 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -53,9 +53,13 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin const char *fileToStart = NULL; const char *fileToLog = NULL; - bool showLog = false; + bool hideLog = true; bool autoRun = true; +#ifdef _DEBUG + hideLog = false; +#endif + g_Config.Load(); VFSRegister("", new DirectoryAssetReader("assets/")); VFSRegister("", new DirectoryAssetReader("")); @@ -79,7 +83,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin g_Config.iCpuCore = CPU_FASTINTERPRETER; break; case 'l': - showLog = true; + hideLog = false; break; case 's': autoRun = false; @@ -139,11 +143,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin LogManager::Init(); if (fileToLog != NULL) LogManager::GetInstance()->ChangeFileLog(fileToLog); - bool hidden = false; -#ifndef _DEBUG - hidden = true; -#endif - LogManager::GetInstance()->GetConsoleListener()->Open(hidden, 150, 120, "PPSSPP Debug Console"); + LogManager::GetInstance()->GetConsoleListener()->Open(hideLog, 150, 120, "PPSSPP Debug Console"); LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); if (fileToStart != NULL) { @@ -156,8 +156,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin else MainWindow::BrowseAndBoot(); - if (showLog) - PostMessage(hwndMain, WM_COMMAND, ID_DEBUG_LOG, 0); if (autoRun) MainWindow::SetNextState(CORE_RUNNING);