Refactor Windows show log switch.

This commit is contained in:
Unknown W. Brackets 2012-12-22 09:54:07 -08:00
parent 7aa7640e87
commit ecffa492f6

View File

@ -53,9 +53,13 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
const char *fileToStart = NULL; const char *fileToStart = NULL;
const char *fileToLog = NULL; const char *fileToLog = NULL;
bool showLog = false; bool hideLog = true;
bool autoRun = true; bool autoRun = true;
#ifdef _DEBUG
hideLog = false;
#endif
g_Config.Load(); g_Config.Load();
VFSRegister("", new DirectoryAssetReader("assets/")); VFSRegister("", new DirectoryAssetReader("assets/"));
VFSRegister("", new DirectoryAssetReader("")); VFSRegister("", new DirectoryAssetReader(""));
@ -79,7 +83,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
g_Config.iCpuCore = CPU_FASTINTERPRETER; g_Config.iCpuCore = CPU_FASTINTERPRETER;
break; break;
case 'l': case 'l':
showLog = true; hideLog = false;
break; break;
case 's': case 's':
autoRun = false; autoRun = false;
@ -139,11 +143,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
LogManager::Init(); LogManager::Init();
if (fileToLog != NULL) if (fileToLog != NULL)
LogManager::GetInstance()->ChangeFileLog(fileToLog); LogManager::GetInstance()->ChangeFileLog(fileToLog);
bool hidden = false; LogManager::GetInstance()->GetConsoleListener()->Open(hideLog, 150, 120, "PPSSPP Debug Console");
#ifndef _DEBUG
hidden = true;
#endif
LogManager::GetInstance()->GetConsoleListener()->Open(hidden, 150, 120, "PPSSPP Debug Console");
LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR);
if (fileToStart != NULL) if (fileToStart != NULL)
{ {
@ -156,8 +156,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
else else
MainWindow::BrowseAndBoot(); MainWindow::BrowseAndBoot();
if (showLog)
PostMessage(hwndMain, WM_COMMAND, ID_DEBUG_LOG, 0);
if (autoRun) if (autoRun)
MainWindow::SetNextState(CORE_RUNNING); MainWindow::SetNextState(CORE_RUNNING);