shithub: cstory

Download patch

ref: b5292f0ce75e8c8afcb8a098dab502bce9c2b0a1
parent: f9993b264c49452919da40b9695b39cc452421fa
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Oct 11 17:28:04 EDT 2020

Update remaining platform backends

--- a/src/Backends/Platform/GLFW3.cpp
+++ b/src/Backends/Platform/GLFW3.cpp
@@ -188,9 +188,10 @@
 	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;
--- a/src/Backends/Platform/Null.cpp
+++ b/src/Backends/Platform/Null.cpp
@@ -22,9 +22,10 @@
 	
 }
 
-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;
 }
--- a/src/Backends/Platform/SDL2.cpp
+++ b/src/Backends/Platform/SDL2.cpp
@@ -89,7 +89,7 @@
 	
 }
 
-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.
@@ -96,7 +96,8 @@
 	// 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,8 +108,10 @@
 	// 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
--- a/src/Backends/Platform/WiiU.cpp
+++ b/src/Backends/Platform/WiiU.cpp
@@ -59,14 +59,16 @@
 	
 }
 
-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;
 }