From fb0102eb8ebe80941dde26a5b7d215591eb83431 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 20 Nov 2023 01:50:31 +0300 Subject: [PATCH] filesystem: add support for two new liblist.gam keys: animated_title and hd_background --- Documentation/gameinfo.md | 4 ++++ filesystem/filesystem.c | 18 ++++++++++++++++++ filesystem/filesystem.h | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/Documentation/gameinfo.md b/Documentation/gameinfo.md index 4f12ca82..af9109ec 100644 --- a/Documentation/gameinfo.md +++ b/Documentation/gameinfo.md @@ -70,9 +70,11 @@ These strings are specific to Xash3D FWGS. | Key | Type | Default value | Description | | ----------------------- | ---------- | ------------------------ | ----------- | +| `animated_title` | boolean | 0 | Use animated title in main menu (WON Half-Life logo.avi imitation from Half-Life 25-th anniversary update) | `autosave_aged_count` | integer | 2 | Auto saves limit used in saves rotation | | `gamedll_linux` | string | Generated from `gamedll` | Game server DLL for 32-bit x86 Linux (see LibraryNaming.md for details) | | `gamedll_osx` | string | Generated from `gamedll` | Game server DLL for 32-bit x86 macOS (see LibraryNaming.md for details) | +| `hd_background` | boolean | 0 | Use HD background for main menu (Half-Life 25-th anniversary update) | | `internal_vgui_support` | boolean | 0 | Only for programmers! Required to be set as 1 for PrimeXT!
When set to 1, the engine will not load vgui_support DLL, as VGUI support is done (or intentionally ignored) on the game side. | | `render_picbutton_text` | boolean | 0 | When set to 1, the UI will not use prerendered `btns_main.bmp` and dynamically render them instead | | `quicksave_aged_count` | integer | 2 | Quick saves limit used in saves rotation | @@ -88,6 +90,7 @@ The table below defines conversion rules from liblist.gam to gameinfo.txt. Some | `liblist.gam` key | `gameinfo.txt` key | Note | | ----------------- | ------------------ | ---- | +| `animated_title` | `animated_title` | | | `edicts` | `max_edicts` | | | `fallback_dir` | `fallback_dir` | | | `game` | `title` | | @@ -95,6 +98,7 @@ The table below defines conversion rules from liblist.gam to gameinfo.txt. Some | `gamedll` | `gamedll` | | | `gamedll_linux` | `gamedll_linux` | | | `gamedll_osx` | `gamedll_osx` | | +| `hd_background` | `hd_background` | | | `icon` | `icon` | | | `mpentity` | `mp_entity` | | | `mpfilter` | `mp_filter` | | diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index dad18113..b741657f 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -613,6 +613,13 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo ) FS_Printf( f, "autosave_aged_count\t\t%d\n", GameInfo->autosave_aged_count ); #undef SAVE_AGED_COUNT + // HL25 compatibility + if( GameInfo->animated_title ) + FS_Printf( f, "animated_title\t\t%i\n", GameInfo->animated_title ); + + if( GameInfo->hd_background ) + FS_Printf( f, "hd_background\t\t%i\n", GameInfo->hd_background ); + // 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" ); @@ -790,6 +797,17 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool pfile = COM_ParseFile( pfile, token, sizeof( token )); GameInfo->max_edicts = bound( MIN_EDICTS, Q_atoi( token ), MAX_EDICTS ); } + // valid for both + else if( !Q_stricmp( token, "hd_background" )) + { + pfile = COM_ParseFile( pfile, token, sizeof( token )); + GameInfo->hd_background = Q_atoi( token ) ? true : false; + } + else if( !Q_stricmp( token, "animated_title" )) + { + pfile = COM_ParseFile( pfile, token, sizeof( token )); + GameInfo->animated_title = Q_atoi( token ) ? true : false; + } // only for gameinfo else if( isGameInfo ) { diff --git a/filesystem/filesystem.h b/filesystem/filesystem.h index 031a6e0f..4a06c31e 100644 --- a/filesystem/filesystem.h +++ b/filesystem/filesystem.h @@ -106,6 +106,10 @@ typedef struct gameinfo_s int quicksave_aged_count; // min is 1, max is 99 int autosave_aged_count; // min is 1, max is 99 + + // HL25 compatibility keys + qboolean hd_background; + qboolean animated_title; } gameinfo_t; typedef enum