Browse Source

filesystem: add two new gameinfo.txt keys quicksave_aged_count and autosave_aged_count that control the amount of quick/autosaves rotated

pull/2/head
Alibek Omarov 1 year ago
parent
commit
88c560aac4
  1. 19
      filesystem/filesystem.c
  2. 3
      filesystem/filesystem.h

19
filesystem/filesystem.c

@ -598,11 +598,18 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo ) @@ -598,11 +598,18 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
if( GameInfo->noskills )
FS_Printf( f, "noskills\t\t\"%i\"\n", GameInfo->nomodels );
#define SAVE_AGED_COUNT 2 // the default count of quick and auto saves
if( GameInfo->quicksave_aged_count != SAVE_AGED_COUNT )
FS_Printf( f, "quicksave_aged_count\t\t%d\n", GameInfo->quicksave_aged_count );
if( GameInfo->autosave_aged_count != SAVE_AGED_COUNT )
FS_Printf( f, "autosave_aged_count\t\t%d\n", GameInfo->autosave_aged_count );
#undef SAVE_AGED_COUNT
// always expose our extensions :)
FS_Printf( f, "internal_vgui_support\t\t%s\n", GameInfo->internal_vgui_support ? "1" : "0" );
FS_Printf( f, "render_picbutton_text\t\t%s\n", GameInfo->render_picbutton_text ? "1" : "0" );
FS_Print( f, "\n\n\n" );
FS_Close( f ); // all done
}
@ -847,6 +854,16 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool @@ -847,6 +854,16 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->internal_vgui_support = Q_atoi( token );
}
else if( !Q_stricmp( token, "quicksave_aged_count" ))
{
pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->quicksave_aged_count = bound( 2, Q_atoi( token ), 99 );
}
else if( !Q_stricmp( token, "autosave_aged_count" ))
{
pfile = COM_ParseFile( pfile, token, sizeof( token ));
GameInfo->autosave_aged_count = bound( 2, Q_atoi( token ), 99 );
}
}
}

3
filesystem/filesystem.h

@ -100,6 +100,9 @@ typedef struct gameinfo_s @@ -100,6 +100,9 @@ typedef struct gameinfo_s
char game_dll_osx[64]; // custom path for game.dll
qboolean added;
int quicksave_aged_count; // min is 1, max is 99
int autosave_aged_count; // min is 1, max is 99
} gameinfo_t;
typedef enum

Loading…
Cancel
Save