Browse Source

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
pull/2/head
Alibek Omarov 2 years ago
parent
commit
6e864e4f8f
  1. 13
      engine/common/common.h
  2. 15
      engine/common/host.c

13
engine/common/common.h

@ -307,6 +307,16 @@ typedef struct
float scale; // curstate.scale float scale; // curstate.scale
} tentlist_t; } 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 typedef struct host_parm_s
{ {
HINSTANCE hInst; 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 struct decallist_s *decalList; // used for keep decals, when renderer is restarted or changed
int numdecals; int numdecals;
// bug compatibility level, for very "special" games
bugcomp_t bugcomp;
} host_parm_t; } host_parm_t;
extern host_parm_t host; extern host_parm_t host;

15
engine/common/host.c

@ -151,6 +151,8 @@ void Sys_PrintUsage( void )
O("-clientlib <path>","override client DLL path") O("-clientlib <path>","override client DLL path")
#endif #endif
O("-rodir <path> ","set read-only base directory, experimental") 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("-ip <ip> ","set custom ip")
O("-port <port> ","set custom host port") 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( "-disablehelp" ) )
{ {
if( Sys_CheckParm( "-help" ) || Sys_CheckParm( "-h" ) || Sys_CheckParm( "--help" ) ) if( Sys_CheckParm( "-help" ) || Sys_CheckParm( "-h" ) || Sys_CheckParm( "--help" ) )
{ {
Sys_PrintUsage(); Sys_PrintUsage();
} }
} }
if( !Sys_CheckParm( "-noch" ) ) if( !Sys_CheckParm( "-noch" ) )
@ -941,6 +943,13 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
// member console allowing // member console allowing
host.allow_console_init = host.allow_console; 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? // timeBeginPeriod( 1 ); // a1ba: Do we need this?
// NOTE: this message couldn't be passed into game console but it doesn't matter // NOTE: this message couldn't be passed into game console but it doesn't matter

Loading…
Cancel
Save