From cf0201eeea5605be9e49672d4109bae6e1865e81 Mon Sep 17 00:00:00 2001 From: "Zephaniah E. Hull" Date: Wed, 1 Mar 2000 11:29:21 +0000 Subject: [PATCH] cvar system fixes.. Knghtbrd owes me for this one.. --- common/gl_rmisc.c | 2 -- common/gl_screen.c | 17 +++++++++++------ common/host.c | 3 ++- common/qargs.c | 2 +- qw_client/screen.c | 16 ++++++++++------ qw_common/screen.h | 1 + uquake/screen.c | 16 ++++++++++------ uquake/screen.h | 1 + 8 files changed, 36 insertions(+), 22 deletions(-) diff --git a/common/gl_rmisc.c b/common/gl_rmisc.c index 188196f..f8eaf48 100644 --- a/common/gl_rmisc.c +++ b/common/gl_rmisc.c @@ -203,9 +203,7 @@ void R_Init (void) #endif /* QUAKEWORLD */ r_fog = Cvar_Get ("r_fog","0",0,"None"); r_waterwarp = Cvar_Get ("r_waterwarp","0",0,"None"); -#ifdef _EXPERIMENTAL_ r_volfog = Cvar_Get ("r_volfog","0",0,"None"); -#endif r_waterripple = Cvar_Get ("r_waterripple","0",0,"None"); r_clearcolor = Cvar_Get ("r_clearcolor","2",0,"None"); diff --git a/common/gl_screen.c b/common/gl_screen.c index 6bf0356..58030c8 100644 --- a/common/gl_screen.c +++ b/common/gl_screen.c @@ -386,12 +386,7 @@ void SCR_SizeDown_f (void) //============================================================================ -/* -================== -SCR_Init -================== -*/ -void SCR_Init (void) +void SCR_InitCvars (void) { scr_fov = Cvar_Get ("fov","90",0,"None"); scr_viewsize = Cvar_Get ("viewsize","100",CVAR_ARCHIVE,"None"); @@ -402,7 +397,17 @@ void SCR_Init (void) scr_centertime = Cvar_Get ("scr_centertime","2",0,"None"); scr_printspeed = Cvar_Get ("scr_printspeed","8",0,"None"); scr_allowsnap = Cvar_Get ("scr_allowsnap","1",0,"None"); + gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None"); +} +/* +================== +SCR_Init +================== +*/ + +void SCR_Init (void) +{ // // register our commands // diff --git a/common/host.c b/common/host.c index 5b1f822..4589095 100644 --- a/common/host.c +++ b/common/host.c @@ -548,7 +548,8 @@ Host_Init ( quakeparms_t *parms) Sys_Error ("Only %4.1fMB of memory reported, can't execute game", parms->memsize / (float) 0x100000); Memory_Init (parms->membase, parms->memsize); - CL_InitCvars (); + CL_InitCvars(); + SCR_InitCvars(); VID_InitCvars (); Cbuf_Init (); Cmd_Init (); diff --git a/common/qargs.c b/common/qargs.c index 4a11b2c..1ec1674 100644 --- a/common/qargs.c +++ b/common/qargs.c @@ -108,7 +108,7 @@ void COM_InitArgv (int argc, char **argv) assert(len - strlen(com_cmdline) > 0); strncat (com_cmdline, " ", len); } - com_cmdline[len] = 0; + com_cmdline[len - 1] = '\0'; if (safe) { diff --git a/qw_client/screen.c b/qw_client/screen.c index 86af57c..ed0ede9 100644 --- a/qw_client/screen.c +++ b/qw_client/screen.c @@ -385,12 +385,7 @@ void SCR_SizeDown_f (void) //============================================================================ -/* -================== -SCR_Init -================== -*/ -void SCR_Init (void) +void SCR_InitCvars (void) { // Cvar_RegisterVariable (&scr_fov); scr_fov = Cvar_Get ("fov","90",0,"None"); @@ -410,6 +405,15 @@ void SCR_Init (void) scr_printspeed = Cvar_Get ("scr_printspeed","8",0,"None"); // Cvar_RegisterVariable (&scr_allowsnap); scr_allowsnap = Cvar_Get ("scr_allowsnap","1",0,"None"); +} + +/* +================== +SCR_Init +================== +*/ +void SCR_Init (void) +{ // // register our commands diff --git a/qw_common/screen.h b/qw_common/screen.h index e47ffac..03f9006 100644 --- a/qw_common/screen.h +++ b/qw_common/screen.h @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // screen.h +void SCR_InitCvars (void); void SCR_Init (void); void SCR_UpdateScreen (void); diff --git a/uquake/screen.c b/uquake/screen.c index 69db14e..1dd436c 100644 --- a/uquake/screen.c +++ b/uquake/screen.c @@ -389,12 +389,7 @@ void SCR_SizeDown_f (void) //============================================================================ -/* -================== -SCR_Init -================== -*/ -void SCR_Init (void) +void SCR_InitCvars (void) { // Cvar_RegisterVariable (&scr_fov); scr_fov = Cvar_Get ("fov","90",0,"None"); @@ -412,6 +407,15 @@ void SCR_Init (void) scr_centertime = Cvar_Get ("scr_centertime","2",0,"None"); // Cvar_RegisterVariable (&scr_printspeed); scr_printspeed = Cvar_Get ("scr_printspeed","8",0,"None"); +} + +/* +================== +SCR_Init +================== +*/ +void SCR_Init (void) +{ // // register our commands diff --git a/uquake/screen.h b/uquake/screen.h index 0266b99..27ea465 100644 --- a/uquake/screen.h +++ b/uquake/screen.h @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // screen.h +void SCR_InitCvars (void); void SCR_Init (void); void SCR_UpdateScreen (void);