From 9f9981512160ca33ae6a9a8b1af2321ec62dee8b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 15 Sep 2013 11:02:13 +0200 Subject: [PATCH] Must detect language before loading config. Should fix #3763 broken by #3750 . --- Windows/main.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Windows/main.cpp b/Windows/main.cpp index 6af19d5e3..358859cc8 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -89,6 +89,23 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin bool hideLog = false; #endif + VFSRegister("", new DirectoryAssetReader("assets/")); + VFSRegister("", new DirectoryAssetReader("")); + + wchar_t lcCountry[256]; + + // LOCALE_SNAME is only available in WinVista+ + // Really should find a way to do this in XP too :/ + if (0 != GetLocaleInfo(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, lcCountry, 256)) { + langRegion = ConvertWStringToUTF8(lcCountry); + for (int i = 0; i < langRegion.size(); i++) { + if (langRegion[i] == '-') + langRegion[i] = '_'; + } + } else { + langRegion = "en_US"; + } + // Load config up here, because those changes below would be overwritten // if it's not loaded here first. g_Config.Load(); @@ -120,23 +137,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin } } - VFSRegister("", new DirectoryAssetReader("assets/")); - VFSRegister("", new DirectoryAssetReader("")); - - wchar_t lcCountry[256]; - - // LOCALE_SNAME is only available in WinVista+ - // Really should find a way to do this in XP too :/ - if (0 != GetLocaleInfo(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, lcCountry, 256)) { - langRegion = ConvertWStringToUTF8(lcCountry); - for (size_t i = 0; i < langRegion.size(); i++) { - if (langRegion[i] == '-') - langRegion[i] = '_'; - } - } else { - langRegion = "en_US"; - } - LogManager::Init(); LogManager::GetInstance()->GetConsoleListener()->Open(hideLog, 150, 120, "PPSSPP Debug Console");