From b5292f0ce75e8c8afcb8a098dab502bce9c2b0a1 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 11 Oct 2020 21:28:04 +0100 Subject: [PATCH] Update remaining platform backends --- src/Backends/Platform/GLFW3.cpp | 5 +++-- src/Backends/Platform/Null.cpp | 5 +++-- src/Backends/Platform/SDL2.cpp | 9 ++++++--- src/Backends/Platform/WiiU.cpp | 10 ++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/Backends/Platform/GLFW3.cpp b/src/Backends/Platform/GLFW3.cpp index 1d94e13b..59089557 100644 --- a/src/Backends/Platform/GLFW3.cpp +++ b/src/Backends/Platform/GLFW3.cpp @@ -188,9 +188,10 @@ void Backend_PostWindowCreation(void) glfwSetWindowSizeCallback(window, WindowSizeCallback); } -bool Backend_GetBasePath(std::string *string_buffer) +bool Backend_GetPaths(std::string *module_path, std::string *data_path) { - (void)string_buffer; + (void)module_path; + (void)data_path; // GLFW3 doesn't seem to have a mechanism for this return false; diff --git a/src/Backends/Platform/Null.cpp b/src/Backends/Platform/Null.cpp index 6d45e82d..acaaa35b 100644 --- a/src/Backends/Platform/Null.cpp +++ b/src/Backends/Platform/Null.cpp @@ -22,9 +22,10 @@ void Backend_PostWindowCreation(void) } -bool Backend_GetBasePath(std::string *string_buffer) +bool Backend_GetPaths(std::string *module_path, std::string *data_path) { - (void)string_buffer; + (void)module_path; + (void)data_path; return false; } diff --git a/src/Backends/Platform/SDL2.cpp b/src/Backends/Platform/SDL2.cpp index fac0d1fc..1ab1dcbb 100644 --- a/src/Backends/Platform/SDL2.cpp +++ b/src/Backends/Platform/SDL2.cpp @@ -89,14 +89,15 @@ void Backend_PostWindowCreation(void) } -bool Backend_GetBasePath(std::string *string_buffer) +bool Backend_GetPaths(std::string *module_path, std::string *data_path) { #ifdef _WIN32 // SDL_GetBasePath returns a UTF-8 string, but Windows' fopen uses (extended?) ASCII. // This is apparently a problem for accented characters, as they will make fopen fail. // So, instead, we rely on argv[0], as that will put the accented characters in a // format Windows will understand. - (void)string_buffer; + (void)module_path; + (void)data_path; return false; #else @@ -107,9 +108,11 @@ bool Backend_GetBasePath(std::string *string_buffer) // Trim the trailing '/' size_t base_path_length = strlen(base_path); base_path[base_path_length - 1] = '\0'; - *string_buffer = base_path; + *module_path = base_path; SDL_free(base_path); + *data_path = *module_path + "/data"; + return true; #endif } diff --git a/src/Backends/Platform/WiiU.cpp b/src/Backends/Platform/WiiU.cpp index f876aed8..934ae51a 100644 --- a/src/Backends/Platform/WiiU.cpp +++ b/src/Backends/Platform/WiiU.cpp @@ -59,15 +59,17 @@ void Backend_PostWindowCreation(void) } -bool Backend_GetBasePath(std::string *string_buffer) +bool Backend_GetPaths(std::string *module_path, std::string *data_path) { - *string_buffer = WHBGetSdCardMountPath(); + *module_path = WHBGetSdCardMountPath(); #ifdef JAPANESE - *string_buffer += "/CSE2-portable-jp"; + *module_path += "/CSE2-portable-jp"; #else - *string_buffer += "/CSE2-portable-en"; + *module_path += "/CSE2-portable-en"; #endif + *data_path = *module_path + "/data"; + return true; }