From e1f8597360e7e7c483760060aea92e482ed97b4b Mon Sep 17 00:00:00 2001 From: Radegast Date: Thu, 22 May 2014 00:33:58 +0100 Subject: [PATCH] Use SDL to find Application Support path. #87 --- neo/sys/posix/posix_main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index 3ccb9c2c..502ab04c 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -49,6 +49,7 @@ If you have questions concerning this license or the applicable additional terms #include #endif +#include "SDL2/SDL.h" #include // RB end @@ -93,7 +94,12 @@ static char exit_spawn[ 1024 ]; const char* Sys_DefaultSavePath() { #ifdef __APPLE__ - sprintf( savepath, "%s/Library/Application Support/rbdoom3bfg", getenv( "HOME" ) ); + char* base_path = SDL_GetPrefPath( "", "rbdoom3bfg" ); + if( base_path ) + { + savepath = SDL_strdup( base_path ); + SDL_free( base_path ); + } #else sprintf( savepath, "%s/.rbdoom3bfg", getenv( "HOME" ) ); #endif