From 47367614a37f53168eba3bff38b386eb007b4c57 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 30 Jun 2020 14:04:53 +0100 Subject: [PATCH] More accuracy improvements That one comment should go in the accurate branch, not here --- src/Backends/Platform/WiiU.cpp | 5 +++-- src/Config.cpp | 3 ++- src/Generic.cpp | 5 +++-- src/Profile.cpp | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Backends/Platform/WiiU.cpp b/src/Backends/Platform/WiiU.cpp index 28dc8d8e..f18be654 100644 --- a/src/Backends/Platform/WiiU.cpp +++ b/src/Backends/Platform/WiiU.cpp @@ -57,10 +57,11 @@ void Backend_PostWindowCreation(void) bool Backend_GetBasePath(std::string *string_buffer) { + *string_buffer = WHBGetSdCardMountPath(); #ifdef JAPANESE - *string_buffer = std::string{WHBGetSdCardMountPath()} + "/CSE2-portable-jp"; + *string_buffer += "/CSE2-portable-jp"; #else - *string_buffer = std::string{WHBGetSdCardMountPath()} + "/CSE2-portable-en"; + *string_buffer += "/CSE2-portable-en"; #endif return true; diff --git a/src/Config.cpp b/src/Config.cpp index 52a26456..02bf5da3 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -17,9 +17,10 @@ BOOL LoadConfigData(CONFIG *conf) // Clear old configuration data memset(conf, 0, sizeof(CONFIG)); - // Open file + // Get path std::string path = gModulePath + '/' + gConfigName; + // Open file FILE *fp = fopen(path.c_str(), "rb"); if (fp == NULL) return FALSE; diff --git a/src/Generic.cpp b/src/Generic.cpp index 64dd00d9..6312bfc1 100644 --- a/src/Generic.cpp +++ b/src/Generic.cpp @@ -50,7 +50,9 @@ BOOL GetCompileVersion(int *v1, int *v2, int *v3, int *v4) void DeleteLog(void) { - std::string path = gModulePath + "/debug.txt"; + std::string path; + + path = gModulePath + "/debug.txt"; remove(path.c_str()); } @@ -83,7 +85,6 @@ BOOL IsKeyFile(const char *name) return TRUE; } -// Some code uses this as CheckFileExists, checking if the return value is -1 long GetFileSizeLong(const char *path) { long len; diff --git a/src/Profile.cpp b/src/Profile.cpp index dae0d570..093ca1ec 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -131,7 +131,7 @@ BOOL LoadProfile(const char *name) path = name; else path = gModulePath + '/' + gDefaultName; - + // Open file fp = fopen(path.c_str(), "rb"); if (fp == NULL)