filesystem: apply caseinsensitivity to file creation

Replace fs_writedir with fs_writepath, exposing current writeable searchpath.
Fix caseinsensitive FS_Search
Remove unused argument from listdirectory()
Minor optimizations and refactoring
This commit is contained in:
Alibek Omarov
2022-12-26 14:39:51 +03:00
parent 41aa867a21
commit fe1aba3561
4 changed files with 170 additions and 213 deletions

View File

@@ -42,14 +42,14 @@ static inline qboolean IsIdGamedir( const char *id )
!Q_strcmp( id, "GAMEDOWNLOAD" );
}
static inline const char* IdToDir( const char *id )
static inline const char *IdToDir( const char *id )
{
if( !Q_strcmp( id, "GAME" ))
return GI->gamefolder;
else if( !Q_strcmp( id, "GAMEDOWNLOAD" ))
return va( "%s/downloaded", GI->gamefolder );
else if( !Q_strcmp( id, "GAMECONFIG" ))
return fs_writedir; // full path here so it's totally our write allowed directory
return fs_writepath->filename; // full path here so it's totally our write allowed directory
else if( !Q_strcmp( id, "PLATFORM" ))
return "platform"; // stub
else if( !Q_strcmp( id, "CONFIG" ))