- simple to convert demo CVARs

This commit is contained in:
Christoph Oelckers 2019-10-22 01:06:02 +02:00
parent c5cb86bf2b
commit 38187a1870
7 changed files with 23 additions and 62 deletions

View file

@ -434,6 +434,9 @@ void C_ForgetCVars (void);
#define CVARD(type,name,def,flags, descr) \ #define CVARD(type,name,def,flags, descr) \
F##type##CVar name (#name, def, flags, nullptr, descr); F##type##CVar name (#name, def, flags, nullptr, descr);
#define CVARD_NAMED(type,name,varname,def,flags, descr) \
F##type##CVar varname (#name, def, flags, nullptr, descr);
extern FBaseCVar *CVars; extern FBaseCVar *CVars;
#endif //__C_CVARS_H__ #endif //__C_CVARS_H__

View file

@ -37,6 +37,7 @@ CUSTOM_CVARD(Int, cl_autovote, 0, CVAR_ARCHIVE, "enable/disable automatic voting
bool G_CheckAutorun(bool button) bool G_CheckAutorun(bool button)
{ {
if (cl_runmode) return button || cl_autorun; if (cl_runmode) return button || cl_autorun;
@ -44,6 +45,17 @@ bool G_CheckAutorun(bool button)
} }
CVARD_NAMED(Bool, demorec_diffcompress, demorec_diffcompress_cvar, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "Compression for diffs")
CVARD_NAMED(Bool, demorec_synccompress, demorec_synccompress_cvar, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "Compression for input")
CVARD_NAMED(Bool, demorec_seeds, demorec_seeds_cvar, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable recording of random seed for later sync checking")
CVARD_NAMED(Bool, demorec_diffs, demorec_diffs_cvar, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable diff recording in demos")
CVARD_NAMED(Bool, demorec_force, demorec_force_cvar, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable forced demo recording")
CVARD_NAMED(Int, demorec_difftics, demorec_difftics_cvar, 60, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "sets game tic interval after which a diff is recorded")
CVARD(Bool, demoplay_diffs, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable application of diffs in demo playback")
CVARD(Bool, demoplay_showsync, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disable display of sync status")
#if 0 #if 0
@ -56,17 +68,6 @@ bool G_CheckAutorun(bool button)
{ "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 }, { "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 },
{ "demorec_diffs","enable/disable diff recording in demos",(void *)&demorec_diffs_cvar, CVAR_BOOL, 0, 1 },
{ "demorec_force","enable/disable forced demo recording",(void *)&demorec_force_cvar, CVAR_BOOL|CVAR_NOSAVE, 0, 1 },
{
"demorec_difftics","sets game tic interval after which a diff is recorded",
(void *)&demorec_difftics_cvar, CVAR_INT, 2, 60*REALGAMETICSPERSEC
},
{ "demorec_diffcompress","Compression method for diffs. (0: none, 1: KSLZW)",(void *)&demorec_diffcompress_cvar, CVAR_BOOL, 0, 1 },
{ "demorec_synccompress","Compression method for input. (0: none, 1: KSLZW)",(void *)&demorec_synccompress_cvar, CVAR_BOOL, 0, 1 },
{ "demorec_seeds","enable/disable recording of random seed for later sync checking",(void *)&demorec_seeds_cvar, CVAR_BOOL, 0, 1 },
{ "demoplay_diffs","enable/disable application of diffs in demo playback",(void *)&demoplay_diffs, CVAR_BOOL, 0, 1 },
{ "demoplay_showsync","enable/disable display of sync status",(void *)&demoplay_showsync, CVAR_BOOL, 0, 1 },
{ "fov", "change the field of view", (void *)&ud.fov, CVAR_INT, 60, 140 }, { "fov", "change the field of view", (void *)&ud.fov, CVAR_INT, 60, 140 },
@ -167,18 +168,6 @@ bool G_CheckAutorun(bool button)
{ "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 }, { "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 },
{ "demorec_diffs","enable/disable diff recording in demos",(void *)&demorec_diffs_cvar, CVAR_BOOL, 0, 1 },
{ "demorec_force","enable/disable forced demo recording",(void *)&demorec_force_cvar, CVAR_BOOL|CVAR_NOSAVE, 0, 1 },
{
"demorec_difftics","sets game tic interval after which a diff is recorded",
(void *)&demorec_difftics_cvar, CVAR_INT, 2, 60*REALGAMETICSPERSEC
},
{ "demorec_diffcompress","Compression method for diffs. (0: none, 1: KSLZW)",(void *)&demorec_diffcompress_cvar, CVAR_INT, 0, 1 },
{ "demorec_synccompress","Compression method for input. (0: none, 1: KSLZW)",(void *)&demorec_synccompress_cvar, CVAR_INT, 0, 1 },
{ "demorec_seeds","enable/disable recording of random seed for later sync checking",(void *)&demorec_seeds_cvar, CVAR_BOOL, 0, 1 },
{ "demoplay_diffs","enable/disable application of diffs in demo playback",(void *)&demoplay_diffs, CVAR_BOOL, 0, 1 },
{ "demoplay_showsync","enable/disable display of sync status",(void *)&demoplay_showsync, CVAR_BOOL, 0, 1 },
{ "fov", "change the field of view", (void *)&ud.fov, CVAR_INT|CVAR_FUNCPTR, 75, 120 }, { "fov", "change the field of view", (void *)&ud.fov, CVAR_INT|CVAR_FUNCPTR, 75, 120 },
{ "hud_althud", "enable/disable alternate mini-hud", (void *)&ud.althud, CVAR_BOOL, 0, 1 }, { "hud_althud", "enable/disable alternate mini-hud", (void *)&ud.althud, CVAR_BOOL, 0, 1 },
@ -286,19 +275,6 @@ int32_t registerosdcommands(void)
// { "color", "changes player palette", (void *)&ud.color, CVAR_INT|CVAR_MULTI, 0, MAXPALOOKUPS-1 }, // { "color", "changes player palette", (void *)&ud.color, CVAR_INT|CVAR_MULTI, 0, MAXPALOOKUPS-1 },
// //
// { "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 }, // { "crosshairscale","changes the size of the crosshair", (void *)&ud.crosshairscale, CVAR_INT, 10, 100 },
//
// { "demorec_diffs","enable/disable diff recording in demos",(void *)&demorec_diffs_cvar, CVAR_BOOL, 0, 1 },
// { "demorec_force","enable/disable forced demo recording",(void *)&demorec_force_cvar, CVAR_BOOL|CVAR_NOSAVE, 0, 1 },
// {
// "demorec_difftics","sets game tic interval after which a diff is recorded",
// (void *)&demorec_difftics_cvar, CVAR_INT, 2, 60*REALGAMETICSPERSEC
// },
// { "demorec_diffcompress","Compression method for diffs. (0: none, 1: KSLZW)",(void *)&demorec_diffcompress_cvar, CVAR_INT, 0, 1 },
// { "demorec_synccompress","Compression method for input. (0: none, 1: KSLZW)",(void *)&demorec_synccompress_cvar, CVAR_INT, 0, 1 },
// { "demorec_seeds","enable/disable recording of random seed for later sync checking",(void *)&demorec_seeds_cvar, CVAR_BOOL, 0, 1 },
// { "demoplay_diffs","enable/disable application of diffs in demo playback",(void *)&demoplay_diffs, CVAR_BOOL, 0, 1 },
// { "demoplay_showsync","enable/disable display of sync status",(void *)&demoplay_showsync, CVAR_BOOL, 0, 1 },
//
// { "hud_althud", "enable/disable alternate mini-hud", (void *)&ud.althud, CVAR_BOOL, 0, 1 }, // { "hud_althud", "enable/disable alternate mini-hud", (void *)&ud.althud, CVAR_BOOL, 0, 1 },
// { "hud_custom", "change the custom hud", (void *)&ud.statusbarcustom, CVAR_INT, 0, ud.statusbarrange }, // { "hud_custom", "change the custom hud", (void *)&ud.statusbarcustom, CVAR_INT, 0, ud.statusbarrange },
// { "hud_position", "aligns the status bar to the bottom/top", (void *)&ud.hudontop, CVAR_BOOL, 0, 1 }, // { "hud_position", "aligns the status bar to the bottom/top", (void *)&ud.hudontop, CVAR_BOOL, 0, 1 },

View file

@ -16,5 +16,13 @@ EXTERN_CVAR(Bool, cl_idplayers)
EXTERN_CVAR(Bool, cl_showcoords) EXTERN_CVAR(Bool, cl_showcoords)
EXTERN_CVAR(Bool, cl_viewbob) EXTERN_CVAR(Bool, cl_viewbob)
EXTERN_CVAR(Bool, cl_weaponsway) EXTERN_CVAR(Bool, cl_weaponsway)
EXTERN_CVAR(Bool, demorec_diffcompress_cvar)
EXTERN_CVAR(Bool, demorec_synccompress_cvar)
EXTERN_CVAR(Bool, demorec_seeds_cvar)
EXTERN_CVAR(Bool, demoplay_diffs)
EXTERN_CVAR(Bool, demoplay_showsync)
EXTERN_CVAR(Bool, demorec_diffs_cvar)
EXTERN_CVAR(Bool, demorec_force_cvar)
EXTERN_CVAR(Int, demorec_difftics_cvar)
bool G_CheckAutorun(bool button); bool G_CheckAutorun(bool button);

View file

@ -49,13 +49,6 @@ static int32_t g_demo_soundToggle;
static int32_t demo_hasdiffs, demorec_diffs=1, demorec_difftics = 2*REALGAMETICSPERSEC; static int32_t demo_hasdiffs, demorec_diffs=1, demorec_difftics = 2*REALGAMETICSPERSEC;
int32_t demoplay_diffs=1; int32_t demoplay_diffs=1;
int32_t demorec_diffs_cvar=1;
int32_t demorec_force_cvar=0;
int32_t demorec_difftics_cvar = 2*REALGAMETICSPERSEC;
int32_t demorec_diffcompress_cvar=1;
int32_t demorec_synccompress_cvar=1;
int32_t demorec_seeds_cvar=1;
int32_t demoplay_showsync=1;
static int32_t demo_synccompress=1, demorec_seeds=1, demo_hasseeds; static int32_t demo_synccompress=1, demorec_seeds=1, demo_hasseeds;

View file

@ -35,14 +35,6 @@ BEGIN_DUKE_NS
extern buildvfs_FILE g_demo_filePtr; extern buildvfs_FILE g_demo_filePtr;
extern char g_firstDemoFile[BMAX_PATH]; extern char g_firstDemoFile[BMAX_PATH];
extern int32_t demoplay_diffs;
extern int32_t demoplay_showsync;
extern int32_t demorec_diffcompress_cvar;
extern int32_t demorec_diffs_cvar;
extern int32_t demorec_difftics_cvar;
extern int32_t demorec_force_cvar;
extern int32_t demorec_seeds_cvar;
extern int32_t demorec_synccompress_cvar;
extern int32_t g_demo_cnt; extern int32_t g_demo_cnt;
extern int32_t g_demo_goalCnt; extern int32_t g_demo_goalCnt;
extern int32_t g_demo_paused; extern int32_t g_demo_paused;

View file

@ -49,9 +49,6 @@ static int32_t g_demo_soundToggle;
static int32_t demo_hasdiffs, demorec_diffs=1, demorec_difftics = 2*REALGAMETICSPERSEC; static int32_t demo_hasdiffs, demorec_diffs=1, demorec_difftics = 2*REALGAMETICSPERSEC;
int32_t demoplay_diffs=1; int32_t demoplay_diffs=1;
int32_t demorec_diffs_cvar=1;
int32_t demorec_force_cvar=0;
int32_t demorec_difftics_cvar = 2*REALGAMETICSPERSEC;
int32_t demorec_diffcompress_cvar=1; int32_t demorec_diffcompress_cvar=1;
int32_t demorec_synccompress_cvar=1; int32_t demorec_synccompress_cvar=1;
int32_t demorec_seeds_cvar=1; int32_t demorec_seeds_cvar=1;

View file

@ -36,14 +36,6 @@ BEGIN_RR_NS
extern FILE *g_demo_filePtr; extern FILE *g_demo_filePtr;
extern char g_firstDemoFile[BMAX_PATH]; extern char g_firstDemoFile[BMAX_PATH];
extern int32_t demoplay_diffs;
extern int32_t demoplay_showsync;
extern int32_t demorec_diffcompress_cvar;
extern int32_t demorec_diffs_cvar;
extern int32_t demorec_difftics_cvar;
extern int32_t demorec_force_cvar;
extern int32_t demorec_seeds_cvar;
extern int32_t demorec_synccompress_cvar;
extern int32_t g_demo_cnt; extern int32_t g_demo_cnt;
extern int32_t g_demo_goalCnt; extern int32_t g_demo_goalCnt;
extern int32_t g_demo_paused; extern int32_t g_demo_paused;