Fix code for Android

This commit is contained in:
JusicP
2021-08-20 19:56:20 +03:00
parent 557c300975
commit 7a91fbebd9
19 changed files with 405 additions and 18 deletions

View File

@@ -341,14 +341,20 @@ bool FileSystem_GetExecutableDir( char *exedir, int exeDirLen )
Q_FixSlashes( exedir );
#ifdef ANDROID
const char* libDir = "lib";
#else
const char* libDir = "bin";
#endif
// Return the bin directory as the executable dir if it's not in there
// because that's really where we're running from...
char ext[MAX_PATH];
Q_StrRight( exedir, 4, ext, sizeof( ext ) );
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, "bin" ) != 0 )
if ( ext[0] != CORRECT_PATH_SEPARATOR || Q_stricmp( ext+1, libDir ) != 0 )
{
Q_strncat( exedir, CORRECT_PATH_SEPARATOR_S, exeDirLen, COPY_ALL_CHARACTERS );
Q_strncat( exedir, "bin", exeDirLen, COPY_ALL_CHARACTERS );
Q_strncat( exedir, libDir, exeDirLen, COPY_ALL_CHARACTERS );
Q_FixSlashes( exedir );
}