engine: check for macOS bundle in SDL_GetBasePath, and fallback to SDL_GetPrefPath for our directory
This commit is contained in:
parent
f0b29bac1b
commit
7da9772143
1 changed files with 9 additions and 4 deletions
|
@ -186,15 +186,20 @@ static qboolean FS_DetermineRootDirectory( char *out, size_t size )
|
|||
Sys_Error( "couldn't find %s data directory", XASH_ENGINE_NAME );
|
||||
return false;
|
||||
#elif ( XASH_SDL == 2 ) && !XASH_NSWITCH // GetBasePath not impl'd in switch-sdl2
|
||||
#if XASH_APPLE
|
||||
path = SDL_GetPrefPath( NULL, XASH_ENGINE_NAME );
|
||||
#else
|
||||
path = SDL_GetBasePath();
|
||||
|
||||
#if XASH_APPLE
|
||||
if( path != NULL && Q_stristr( path, ".app" ))
|
||||
{
|
||||
SDL_free((void *)path );
|
||||
path = SDL_GetPrefPath( NULL, XASH_ENGINE_NAME );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( path != NULL )
|
||||
{
|
||||
Q_strncpy( out, path, size );
|
||||
SDL_free(( void *)path );
|
||||
SDL_free((void *)path );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue