engine: introduce bug compatibility levels

* for now we only have GoldSrc bug compatibility, can be used for
  games that require precise GoldSrc behaviour, like CSCZDS
* enabled with -bugcomp command line
* added text in --help
This commit is contained in:
Alibek Omarov 2022-08-10 06:55:14 +03:00
parent 6ef76fe665
commit 6e864e4f8f
2 changed files with 25 additions and 3 deletions

View File

@ -307,6 +307,16 @@ typedef struct
float scale; // curstate.scale
} tentlist_t;
typedef enum bugcomp_e
{
// default mode, we assume that user dlls are not relying on engine bugs
BUGCOMP_OFF,
// GoldSrc mode, user dlls are relying on GoldSrc specific bugs
// but fixing them may break regular Xash games
BUGCOMP_GOLDSRC,
} bugcomp_t;
typedef struct host_parm_s
{
HINSTANCE hInst;
@ -381,6 +391,9 @@ typedef struct host_parm_s
struct decallist_s *decalList; // used for keep decals, when renderer is restarted or changed
int numdecals;
// bug compatibility level, for very "special" games
bugcomp_t bugcomp;
} host_parm_t;
extern host_parm_t host;

View File

@ -151,6 +151,8 @@ void Sys_PrintUsage( void )
O("-clientlib <path>","override client DLL path")
#endif
O("-rodir <path> ","set read-only base directory, experimental")
O("-bugcomp ","enable precise bug compatibility. Will break games that don't require it")
O(" ","Refer to engine documentation for more info")
O("-ip <ip> ","set custom ip")
O("-port <port> ","set custom host port")
@ -859,10 +861,10 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
if( !Sys_CheckParm( "-disablehelp" ) )
{
if( Sys_CheckParm( "-help" ) || Sys_CheckParm( "-h" ) || Sys_CheckParm( "--help" ) )
{
if( Sys_CheckParm( "-help" ) || Sys_CheckParm( "-h" ) || Sys_CheckParm( "--help" ) )
{
Sys_PrintUsage();
}
}
}
if( !Sys_CheckParm( "-noch" ) )
@ -941,6 +943,13 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
// member console allowing
host.allow_console_init = host.allow_console;
if( Sys_CheckParm( "-bugcomp" ))
{
// add argument check here when we add other levels
// of bugcompatibility
host.bugcomp = BUGCOMP_GOLDSRC;
}
// timeBeginPeriod( 1 ); // a1ba: Do we need this?
// NOTE: this message couldn't be passed into game console but it doesn't matter