Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesystem: massively rework how scanning game directories work #1947

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Documentation/gameinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ These strings are specific to Xash3D FWGS.
As Xash3D accidentally supports GoldSrc games, it also supports parsing liblist.gam.\
Xash3D will use this file if gameinfo.txt is absent, or if its modification timestamp is older than liblist.gam.

> [!NOTE]
> Starting from January 2025, Xash3D FWGS doesn't automatically generate gameinfo.txt from liblist.gam. The key conversion table still remains but if you wish to use gameinfo.txt instead of liblist.gam, you can execute `fs_make_gameinfo` in console.

For game creators who plan supporting only Xash3D, using this file is not recommended.

The table below defines conversion rules from liblist.gam to gameinfo.txt. Some keys' interpretation does differ from `gameinfo.txt`, in this case a note will be left. If `liblist.gam` key isn't present in this table, it's ignored.
Expand Down
6 changes: 6 additions & 0 deletions engine/common/filesystem_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ static void FS_Path_f_( void )
FS_Path_f();
}

static void FS_MakeGameInfo_f( void )
{
g_fsapi.MakeGameInfo();
}

static const fs_interface_t fs_memfuncs =
{
Con_Printf,
Expand Down Expand Up @@ -272,6 +277,7 @@ void FS_Init( const char *basedir )
Cmd_AddRestrictedCommand( "fs_rescan", FS_Rescan_f, "rescan filesystem search pathes" );
Cmd_AddRestrictedCommand( "fs_path", FS_Path_f_, "show filesystem search pathes" );
Cmd_AddRestrictedCommand( "fs_clearpaths", FS_ClearPaths_f, "clear filesystem search pathes" );
Cmd_AddRestrictedCommand( "fs_make_gameinfo", FS_MakeGameInfo_f, "create gameinfo.txt for current running game" );

if( !Sys_GetParmFromCmdLine( "-dll", host.gamedll ))
host.gamedll[0] = 0;
Expand Down
6 changes: 3 additions & 3 deletions filesystem/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void FS_PopulateDirEntries( dir_t *dir, const char *path )
}

stringlistinit( &list );
listdirectory( &list, path );
listdirectory( &list, path, false );
if( !list.numstrings )
{
dir->numentries = DIRENTRY_EMPTY_DIRECTORY;
Expand Down Expand Up @@ -225,7 +225,7 @@ static int FS_MaybeUpdateDirEntries( dir_t *dir, const char *path, const char *e
int ret;

stringlistinit( &list );
listdirectory( &list, path );
listdirectory( &list, path, false );

if( list.numstrings == 0 ) // empty directory
{
Expand Down Expand Up @@ -421,7 +421,7 @@ static void FS_Search_DIR( searchpath_t *search, stringlist_t *list, const char
}

stringlistinit( &dirlist );
listdirectory( &dirlist, netpath );
listdirectory( &dirlist, netpath, false );

Q_strncpy( temp, basepath, sizeof( temp ));

Expand Down
Loading
Loading