diff --git a/src/harness/harness.c b/src/harness/harness.c index 54caa34d..51072745 100644 --- a/src/harness/harness.c +++ b/src/harness/harness.c @@ -224,7 +224,7 @@ void Harness_DetectAndSetWorkingDirectory(char* argv0) { if (access("DATA/GENERAL.TXT", F_OK) == 0) { // good, found } else { - gHarness_platform.GetPrefPath("dethrace", pref_path); + gHarness_platform.GetPrefPath(pref_path, "dethrace"); path = pref_path; } } @@ -481,7 +481,7 @@ static int Harness_Ini_Callback(void* user, const char* section, const char* nam int Harness_ProcessIniFile(void) { int i; char path[1024]; - gHarness_platform.GetPrefPath("dethrace", path); + gHarness_platform.GetPrefPath(path, "dethrace"); strcat(path, "dethrace.ini"); diff --git a/src/harness/include/harness/hooks.h b/src/harness/include/harness/hooks.h index 73e0027c..41afc43e 100644 --- a/src/harness/include/harness/hooks.h +++ b/src/harness/include/harness/hooks.h @@ -47,7 +47,7 @@ typedef struct tHarness_platform { void* (*GL_GetProcAddress)(const char* name); void (*GetViewport)(int* x, int* y, float* width_multiplier, float* height_multiplier); - void (*GetPrefPath)(char* app_name, char* path); + void (*GetPrefPath)(char* path, char* app_name); } tHarness_platform; diff --git a/src/harness/platforms/null.c b/src/harness/platforms/null.c index be2b0e54..c25fe616 100644 --- a/src/harness/platforms/null.c +++ b/src/harness/platforms/null.c @@ -1,4 +1,5 @@ #include "null.h" +#include static uint32_t null_time; @@ -53,6 +54,10 @@ static uint32_t null_getticks(void) { return null_time; } +static void null_get_pref_path(char* path, char* app_name) { + strcpy(path, "."); +} + void Null_Platform_Init(tHarness_platform* platform) { null_time = 0; platform->ProcessWindowMessages = null_get_and_handle_message; @@ -68,4 +73,5 @@ void Null_Platform_Init(tHarness_platform* platform) { platform->ShowErrorMessage = null_show_error_message; platform->Renderer_SetPalette = null_set_palette; + platform->GetPrefPath = null_get_pref_path; } diff --git a/src/harness/platforms/sdl1.c b/src/harness/platforms/sdl1.c index ec9d7ccc..295f0bf5 100644 --- a/src/harness/platforms/sdl1.c +++ b/src/harness/platforms/sdl1.c @@ -286,7 +286,7 @@ static void SDL1_Harness_GetViewport(int* x, int* y, float* width_multipler, flo *height_multiplier = viewport.scale_y; } -static void SDL1_Harness_GetPrefPath(char* app_name, char* path) { +static void SDL1_Harness_GetPrefPath(char* path, char* app_name) { // SDL_GetPrefPath not in SDL1. We could implement it if we really needed to. // for now, just return the current path strcpy(path, "."); diff --git a/src/harness/platforms/sdl2.c b/src/harness/platforms/sdl2.c index eab7b385..f561de2e 100644 --- a/src/harness/platforms/sdl2.c +++ b/src/harness/platforms/sdl2.c @@ -367,7 +367,7 @@ static void SDL2_Harness_GetViewport(int* x, int* y, float* width_multipler, flo *height_multiplier = viewport.scale_y; } -static void SDL2_Harness_GetPrefPath(char* app_name, char* path) { +static void SDL2_Harness_GetPrefPath(char* path, char* app_name) { char* sdl_path = SDL2_GetPrefPath(NULL, app_name); strcpy(path, sdl_path); SDL2_free(sdl_path);