From d56bc40db45f9c191c9947fae778b41cab079bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 25 Dec 2012 08:34:19 +0100 Subject: [PATCH] NativeApp: Load config before processing flags (duh) --- Core/Config.h | 17 ++++++++++++----- android/jni/NativeApp.cpp | 11 +++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Core/Config.h b/Core/Config.h index e70ca017d..ae9ea5191 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -32,30 +32,37 @@ public: CConfig(); ~CConfig(); - // Many of these are currently broken. - bool bEnableSound; - bool bAutoLoadLast; + // Whether to save the config on close. bool bSaveSettings; + + // These are broken + bool bAutoLoadLast; bool bFirstRun; bool bAutoRun; bool bSpeedLimit; bool bConfirmOnQuit; + + // Core bool bIgnoreBadMemAccess; bool bFastMemory; + int iCpuCore; // GFX bool bDisplayFramebuffer; bool bHardwareTransform; bool bBufferedRendering; bool bDrawWireframe; + int iWindowZoom; // for Windows + // Sound + bool bEnableSound; + + // UI bool bShowTouchControls; bool bShowDebuggerOnLoad; bool bShowAnalogStick; bool bShowFPSCounter; bool bShowDebugStats; - int iWindowZoom; // for Windows - int iCpuCore; std::string currentDirectory; std::string memCardDirectory; diff --git a/android/jni/NativeApp.cpp b/android/jni/NativeApp.cpp index 251a98a53..1ed98fba3 100644 --- a/android/jni/NativeApp.cpp +++ b/android/jni/NativeApp.cpp @@ -169,6 +169,10 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co LogManager *logman = LogManager::GetInstance(); ILOG("Logman: %p", logman); + config_filename = user_data_path + "ppsspp.ini"; + + g_Config.Load(config_filename.c_str()); + bool gfxLog = false; // Parse command line LogTypes::LOG_LEVELS logLevel = LogTypes::LINFO; @@ -184,12 +188,15 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co break; case 'j': g_Config.iCpuCore = CPU_JIT; + g_Config.bSaveSettings = false; break; case 'f': g_Config.iCpuCore = CPU_FASTINTERPRETER; + g_Config.bSaveSettings = false; break; case 'i': g_Config.iCpuCore = CPU_INTERPRETER; + g_Config.bSaveSettings = false; break; } } else { @@ -207,10 +214,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co } } - config_filename = user_data_path + "ppsspp.ini"; - - g_Config.Load(config_filename.c_str()); - if (g_Config.currentDirectory == "") { #if defined(ANDROID) || defined(BLACKBERRY) || defined(__SYMBIAN32__) g_Config.currentDirectory = external_directory;