Apply theoddone33's cvar patch (he's having connectivity problems with tank)

This commit is contained in:
Bill Currie 2000-05-17 23:16:23 +00:00
parent 22c85298f0
commit 64d00faa8f
17 changed files with 93 additions and 82 deletions

View file

@ -81,9 +81,10 @@ cvar_t *Cvar_Get (char *name, char *value, int cvarflags, char *description);
void Cvar_Alias_Get (char *name, cvar_t *cvar); void Cvar_Alias_Get (char *name, cvar_t *cvar);
void Cvar_Set (char *var, char *value); void Cvar_Set (cvar_t *var, char *value);
// equivelant to "<name> <variable>" typed at the console // equivelant to "<name> <variable>" typed at the console
void Cvar_SetValue (cvar_t *var, float value);
float Cvar_VariableValue (char *var_name); float Cvar_VariableValue (char *var_name);
// returns 0 if not defined or non numeric // returns 0 if not defined or non numeric

View file

@ -764,12 +764,12 @@ void CDAudio_Update(void)
newVolume = (int)(bgmvolume->value * 255.0); newVolume = (int)(bgmvolume->value * 255.0);
if (newVolume < 0) if (newVolume < 0)
{ {
Cvar_SetValue ("bgmvolume", 0.0); Cvar_SetValue (bgmvolume, 0.0);
newVolume = 0; newVolume = 0;
} }
else if (newVolume > 255) else if (newVolume > 255)
{ {
Cvar_SetValue ("bgmvolume", 1.0); Cvar_SetValue (bgmvolume, 1.0);
newVolume = 255; newVolume = 255;
} }
if (cdvolume != newVolume) if (cdvolume != newVolume)

View file

@ -417,7 +417,7 @@ void CDAudio_Update(void)
{ {
if (cdvolume) if (cdvolume)
{ {
Cvar_SetValue ("bgmvolume", 0.0); Cvar_SetValue (bgmvolume, 0.0);
/* cdvolume = bgmvolume.value; /* cdvolume = bgmvolume.value;
CVAR_FIXME */ CVAR_FIXME */
cdvolume = bgmvolume->value; cdvolume = bgmvolume->value;
@ -425,7 +425,7 @@ void CDAudio_Update(void)
} }
else else
{ {
Cvar_SetValue ("bgmvolume", 1.0); Cvar_SetValue (bgmvolume, 1.0);
/* cdvolume = bgmvolume.value; /* cdvolume = bgmvolume.value;
CVAR_FIXME */ CVAR_FIXME */
cdvolume = bgmvolume->value; cdvolume = bgmvolume->value;

View file

@ -628,9 +628,9 @@ void CL_Color_f (void)
bottom = 13; bottom = 13;
sprintf (num, "%i", top); sprintf (num, "%i", top);
Cvar_Set ("topcolor", num); Cvar_Set (topcolor, num);
sprintf (num, "%i", bottom); sprintf (num, "%i", bottom);
Cvar_Set ("bottomcolor", num); Cvar_Set (bottomcolor, num);
} }
/* /*
@ -965,7 +965,7 @@ void CL_ConnectionlessPacket (void)
"You may need to reload your server browser and %s.\n", "You may need to reload your server browser and %s.\n",
s, localid->string, PROGRAM); s, localid->string, PROGRAM);
Con_Printf("===========================\n"); Con_Printf("===========================\n");
Cvar_Set("localid", ""); Cvar_Set(localid, "");
return; return;
} }

View file

@ -136,7 +136,7 @@ void CL_PredictMove (void)
/* if (cl_pushlatency.value > 0) /* if (cl_pushlatency.value > 0)
CVAR_FIXME */ CVAR_FIXME */
if (cl_pushlatency->value > 0) if (cl_pushlatency->value > 0)
Cvar_Set ("pushlatency", "0"); Cvar_Set (cl_pushlatency, "0");
if (cl.paused) if (cl.paused)
return; return;

View file

@ -1112,7 +1112,7 @@ void COM_CheckRegistered (void)
} }
if (static_registered) { if (static_registered) {
Cvar_Set ("registered", "1"); Cvar_Set (registered, "1");
Con_Printf ("Playing registered version.\n"); Con_Printf ("Playing registered version.\n");
} }
} }

View file

@ -178,16 +178,10 @@ void Cvar_Info (cvar_t *var);
Cvar_Set Cvar_Set
============ ============
*/ */
void Cvar_Set (char *var_name, char *value) void Cvar_Set (cvar_t *var, char *value)
{ {
cvar_t *var;
var = Cvar_FindVar (var_name);
if (!var) if (!var)
{ // there is an error in C code if this happens
Con_Printf ("Cvar_Set: variable %s not found\n", var_name);
return; return;
}
Z_Free (var->string); // free the old value string Z_Free (var->string); // free the old value string
@ -197,6 +191,20 @@ void Cvar_Set (char *var_name, char *value)
Cvar_Info(var); Cvar_Info(var);
} }
/*
============
Cvar_SetValue
============
*/
void Cvar_SetValue (cvar_t *var_name, float value)
{
char val[32];
sprintf (val, "%f",value);
Cvar_Set (var_name, val);
}
/* /*
============ ============
Cvar_Command Cvar_Command
@ -222,7 +230,7 @@ qboolean Cvar_Command (void)
return true; return true;
} }
Cvar_Set (v->name, Cmd_Argv(1)); Cvar_Set (v, Cmd_Argv(1));
return true; return true;
} }
@ -262,7 +270,7 @@ void Cvar_Set_f(void)
var = Cvar_FindAlias (var_name); var = Cvar_FindAlias (var_name);
if (var) if (var)
{ {
Cvar_Set (var->name, value); Cvar_Set (var, value);
} }
else else
{ {
@ -290,7 +298,7 @@ void Cvar_Toggle_f (void)
return; return;
} }
Cvar_Set (var->name, var->value ? "0" : "1"); Cvar_Set (var, var->value ? "0" : "1");
} }
void Cvar_Help_f (void) void Cvar_Help_f (void)

View file

@ -437,12 +437,11 @@ void Draw_Init (void)
/* Cvar_RegisterVariable (&cl_verstring); /* Cvar_RegisterVariable (&cl_verstring);
CVAR_FIXME */ CVAR_FIXME */
cl_verstring = Cvar_Get("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, "None");
// 3dfx can only handle 256 wide textures // 3dfx can only handle 256 wide textures
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) || if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
!Q_strncasecmp ((char *)gl_renderer, "Mesa",4)) !Q_strncasecmp ((char *)gl_renderer, "Mesa",4))
Cvar_Set ("gl_max_size", "256"); Cvar_Set (gl_max_size, "256");
Cmd_AddCommand ("gl_texturemode", &Draw_TextureMode_f); Cmd_AddCommand ("gl_texturemode", &Draw_TextureMode_f);

View file

@ -345,21 +345,21 @@ static void SCR_CalcRefdef (void)
/* if (scr_viewsize.value < 30) /* if (scr_viewsize.value < 30)
CVAR_FIXME */ CVAR_FIXME */
if (scr_viewsize->value < 30) if (scr_viewsize->value < 30)
Cvar_Set ("viewsize","30"); Cvar_Set (scr_viewsize,"30");
/* if (scr_viewsize.value > 120) /* if (scr_viewsize.value > 120)
CVAR_FIXME */ CVAR_FIXME */
if (scr_viewsize->value > 120) if (scr_viewsize->value > 120)
Cvar_Set ("viewsize","120"); Cvar_Set (scr_viewsize,"120");
// bound field of view // bound field of view
/* if (scr_fov.value < 10) /* if (scr_fov.value < 10)
CVAR_FIXME */ CVAR_FIXME */
if (scr_fov->value < 10) if (scr_fov->value < 10)
Cvar_Set ("fov","10"); Cvar_Set (scr_fov,"10");
/* if (scr_fov.value > 170) /* if (scr_fov.value > 170)
CVAR_FIXME */ CVAR_FIXME */
if (scr_fov->value > 170) if (scr_fov->value > 170)
Cvar_Set ("fov","170"); Cvar_Set (scr_fov,"170");
// intermission is always full screen // intermission is always full screen
if (cl.intermission) if (cl.intermission)
@ -441,7 +441,7 @@ void SCR_SizeUp_f (void)
{ {
/* Cvar_SetValue ("viewsize",scr_viewsize.value+10); /* Cvar_SetValue ("viewsize",scr_viewsize.value+10);
CVAR_FIXME */ CVAR_FIXME */
scr_viewsize->value = scr_viewsize->value+10; Cvar_SetValue (scr_viewsize, scr_viewsize->value+10);
vid.recalc_refdef = 1; vid.recalc_refdef = 1;
} }
@ -458,7 +458,7 @@ void SCR_SizeDown_f (void)
{ {
/* Cvar_SetValue ("viewsize",scr_viewsize.value-10); /* Cvar_SetValue ("viewsize",scr_viewsize.value-10);
CVAR_FIXME */ CVAR_FIXME */
scr_viewsize->value = scr_viewsize->value-10; Cvar_SetValue (scr_viewsize, scr_viewsize->value-10);
vid.recalc_refdef = 1; vid.recalc_refdef = 1;
} }

View file

@ -480,7 +480,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
SetForegroundWindow (mainwindow); SetForegroundWindow (mainwindow);
VID_SetPalette (palette); VID_SetPalette (palette);
vid_modenum = modenum; vid_modenum = modenum;
Cvar_SetValue ("vid_mode", (float)vid_modenum); Cvar_SetValue (vid_mode, (float)vid_modenum);
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{ {

View file

@ -410,8 +410,8 @@ void M_AdjustSliders (int dir)
if (scr_viewsize->value > 120) if (scr_viewsize->value > 120)
/* scr_viewsize.value = 120; /* scr_viewsize.value = 120;
CVAR_FIXME */ CVAR_FIXME */
scr_viewsize->value = 120; Cvar_SetValue (scr_viewsize, 120);
/* Cvar_SetValue ("viewsize", scr_viewsize.value); /* Cvar_SetValue (viewsize, scr_viewsize.value);
CVAR_FIXME */ CVAR_FIXME */
break; break;
case 4: // gamma case 4: // gamma
@ -429,7 +429,7 @@ void M_AdjustSliders (int dir)
if (v_gamma->value > 1) if (v_gamma->value > 1)
/* v_gamma.value = 1; /* v_gamma.value = 1;
CVAR_FIXME */ CVAR_FIXME */
v_gamma->value = 1; Cvar_SetValue (v_gamma, 1);
/* Cvar_SetValue ("gamma", v_gamma.value); /* Cvar_SetValue ("gamma", v_gamma.value);
CVAR_FIXME */ CVAR_FIXME */
break; break;
@ -448,7 +448,7 @@ void M_AdjustSliders (int dir)
if (sensitivity->value > 11) if (sensitivity->value > 11)
/* sensitivity.value = 11; /* sensitivity.value = 11;
CVAR_FIXME */ CVAR_FIXME */
sensitivity->value = 11; Cvar_SetValue (sensitivity, 11);
/* Cvar_SetValue ("sensitivity", sensitivity.value); /* Cvar_SetValue ("sensitivity", sensitivity.value);
CVAR_FIXME */ CVAR_FIXME */
break; break;
@ -456,43 +456,43 @@ void M_AdjustSliders (int dir)
#ifdef _WIN32 #ifdef _WIN32
/* bgmvolume.value += dir * 1.0; /* bgmvolume.value += dir * 1.0;
CVAR_FIXME */ CVAR_FIXME */
bgmvolume->value += dir * 1.0; Cvar_SetValue (bgmvolume, bgmvolume->value + dir * 1.0);
#else #else
/* bgmvolume.value += dir * 0.1; /* bgmvolume.value += dir * 0.1;
CVAR_FIXME */ CVAR_FIXME */
bgmvolume->value += dir * 0.1; Cvar_SetValue (bgmvolume, bgmvolume->value + dir * 0.1);
#endif #endif
/* if (bgmvolume.value < 0) /* if (bgmvolume.value < 0)
CVAR_FIXME */ CVAR_FIXME */
if (bgmvolume->value < 0) if (bgmvolume->value < 0)
/* bgmvolume.value = 0; /* bgmvolume.value = 0;
CVAR_FIXME */ CVAR_FIXME */
bgmvolume->value = 0; Cvar_SetValue (bgmvolume, 0);
/* if (bgmvolume.value > 1) /* if (bgmvolume.value > 1)
CVAR_FIXME */ CVAR_FIXME */
if (bgmvolume->value > 1) if (bgmvolume->value > 1)
/* bgmvolume.value = 1; /* bgmvolume.value = 1;
CVAR_FIXME */ CVAR_FIXME */
bgmvolume->value = 1; Cvar_SetValue (bgmvolume, 1);
/* Cvar_SetValue ("bgmvolume", bgmvolume.value); /* Cvar_SetValue ("bgmvolume", bgmvolume.value);
CVAR_FIXME */ CVAR_FIXME */
break; break;
case 7: // sfx volume case 7: // sfx volume
/* volume.value += dir * 0.1; /* volume.value += dir * 0.1;
CVAR_FIXME */ CVAR_FIXME */
volume->value += dir * 0.1; Cvar_SetValue (volume, volume->value + dir * 0.1);
/* if (volume.value < 0) /* if (volume.value < 0)
CVAR_FIXME */ CVAR_FIXME */
if (volume->value < 0) if (volume->value < 0)
/* volume.value = 0; /* volume.value = 0;
CVAR_FIXME */ CVAR_FIXME */
volume->value = 0; Cvar_SetValue (volume, 0);
/* if (volume.value > 1) /* if (volume.value > 1)
CVAR_FIXME */ CVAR_FIXME */
if (volume->value > 1) if (volume->value > 1)
/* volume.value = 1; /* volume.value = 1;
CVAR_FIXME */ CVAR_FIXME */
volume->value = 1; Cvar_SetValue (volume, 1);
/*CVAR_FIXME */ /*CVAR_FIXME */
break; break;
@ -501,49 +501,50 @@ void M_AdjustSliders (int dir)
CVAR_FIXME */ CVAR_FIXME */
if (cl_forwardspeed->value > 200) if (cl_forwardspeed->value > 200)
{ {
cl_forwardspeed->value = 200; Cvar_SetValue (cl_forwardspeed, 200);
cl_backspeed->value = 200; Cvar_SetValue (cl_backspeed, 200);
} }
else else
{ {
cl_forwardspeed->value = 400; Cvar_SetValue (cl_forwardspeed, 400);
cl_backspeed->value = 400; Cvar_SetValue (cl_backspeed, 400);
} }
break; break;
case 9: // invert mouse case 9: // invert mouse
/* m_pitch- -m_pitch.value); /* m_pitch- -m_pitch.value);
CVAR_FIXME */ CVAR_FIXME */
m_pitch->value = -m_pitch->value; Cvar_SetValue (m_pitch, -m_pitch->value);
break; break;
case 10: // lookspring case 10: // lookspring
/* Cvar_SetValue ("lookspring", !lookspring.value); /* Cvar_SetValue ("lookspring", !lookspring.value);
CVAR_FIXME */ CVAR_FIXME */
lookspring->value = !lookspring->value; Cvar_SetValue (lookspring, !lookspring->value);
break; break;
case 11: // lookstrafe case 11: // lookstrafe
/* Cvar_SetValue ("lookstrafe", !lookstrafe.value); /* Cvar_SetValue ("lookstrafe", !lookstrafe.value);
CVAR_FIXME */ CVAR_FIXME */
lookstrafe->value = !lookstrafe->value; Cvar_SetValue (lookstrafe, !lookstrafe->value);
break; break;
case 12: case 12:
/* Cvar_SetValue ("cl_sbar", !cl_sbar.value); /* Cvar_SetValue ("cl_sbar", !cl_sbar.value);
CVAR_FIXME */ CVAR_FIXME */
cl_sbar->value = !cl_sbar->value; Cvar_SetValue (cl_sbar, !cl_sbar->value);
break; break;
case 13: case 13:
/* Cvar_SetValue ("cl_hudswap", !cl_hudswap.value); /* Cvar_SetValue ("cl_hudswap", !cl_hudswap.value);
CVAR_FIXME */ CVAR_FIXME */
cl_hudswap->value = !cl_hudswap->value; Cvar_SetValue (cl_hudswap, !cl_hudswap->value);
break;
case 15: // _windowed_mouse case 15: // _windowed_mouse
/* Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value); /* Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
CVAR_FIXME */ CVAR_FIXME */
_windowed_mouse->value = !_windowed_mouse->value; Cvar_SetValue (_windowed_mouse, !_windowed_mouse->value);
break; break;
} }
} }

View file

@ -754,11 +754,13 @@ float cvar (string)
*/ */
void PF_cvar_set (void) void PF_cvar_set (void)
{ {
char *var, *val; char *var_name, *val;
cvar_t *var;
var = G_STRING(OFS_PARM0); var_name = G_STRING(OFS_PARM0);
val = G_STRING(OFS_PARM1); val = G_STRING(OFS_PARM1);
var = Cvar_FindVar(var_name);
Cvar_Set (var, val); Cvar_Set (var, val);
} }

View file

@ -322,21 +322,21 @@ static void SCR_CalcRefdef (void)
/* if (scr_viewsize.value < 30) /* if (scr_viewsize.value < 30)
CVAR_FIXME */ CVAR_FIXME */
if (scr_viewsize->value < 30) if (scr_viewsize->value < 30)
Cvar_Set ("viewsize","30"); Cvar_Set (scr_viewsize,"30");
/* if (scr_viewsize.value > 120) /* if (scr_viewsize.value > 120)
CVAR_FIXME */ CVAR_FIXME */
if (scr_viewsize->value > 120) if (scr_viewsize->value > 120)
Cvar_Set ("viewsize","120"); Cvar_Set (scr_viewsize,"120");
// bound field of view // bound field of view
/* if (scr_fov.value < 10) /* if (scr_fov.value < 10)
CVAR_FIXME */ CVAR_FIXME */
if (scr_fov->value < 10) if (scr_fov->value < 10)
Cvar_Set ("fov","10"); Cvar_Set (scr_fov,"10");
/* if (scr_fov.value > 170) /* if (scr_fov.value > 170)
CVAR_FIXME */ CVAR_FIXME */
if (scr_fov->value > 170) if (scr_fov->value > 170)
Cvar_Set ("fov","170"); Cvar_Set (scr_fov,"170");
/* r_refdef.fov_x = scr_fov.value; /* r_refdef.fov_x = scr_fov.value;
CVAR_FIXME */ CVAR_FIXME */
@ -391,7 +391,7 @@ void SCR_SizeUp_f (void)
if (scr_viewsize->value < 120) { if (scr_viewsize->value < 120) {
/* Cvar_SetValue ("viewsize",scr_viewsize.value+10); /* Cvar_SetValue ("viewsize",scr_viewsize.value+10);
CVAR_FIXME */ CVAR_FIXME */
scr_viewsize->value = scr_viewsize->value+10; Cvar_SetValue (scr_viewsize,scr_viewsize->value+10);
vid.recalc_refdef = 1; vid.recalc_refdef = 1;
} }
} }
@ -408,7 +408,7 @@ void SCR_SizeDown_f (void)
{ {
/* Cvar_SetValue ("viewsize",scr_viewsize.value-10); /* Cvar_SetValue ("viewsize",scr_viewsize.value-10);
CVAR_FIXME */ CVAR_FIXME */
scr_viewsize->value = scr_viewsize->value-10; Cvar_SetValue (scr_viewsize,scr_viewsize->value-10);
vid.recalc_refdef = 1; vid.recalc_refdef = 1;
} }

View file

@ -255,7 +255,7 @@ void S_Init (void)
if (host_parms.memsize < 0x800000) if (host_parms.memsize < 0x800000)
{ {
Cvar_Set ("loadas8bit", "1"); Cvar_Set (loadas8bit, "1");
Con_Printf ("loading all sounds as 8bit\n"); Con_Printf ("loading all sounds as 8bit\n");
} }

View file

@ -715,17 +715,17 @@ void SVC_DirectConnect (void)
/* if ( maxclients.value > MAX_CLIENTS ) /* if ( maxclients.value > MAX_CLIENTS )
CVAR_FIXME */ CVAR_FIXME */
if ( maxclients->value > MAX_CLIENTS ) if ( maxclients->value > MAX_CLIENTS )
maxclients->value = MAX_CLIENTS; Cvar_SetValue (maxclients, MAX_CLIENTS);
/* if (maxspectators.value > MAX_CLIENTS) /* if (maxspectators.value > MAX_CLIENTS)
CVAR_FIXME */ CVAR_FIXME */
if (maxspectators->value > MAX_CLIENTS) if (maxspectators->value > MAX_CLIENTS)
maxspectators->value = MAX_CLIENTS; Cvar_SetValue (maxspectators, MAX_CLIENTS);
/* if (maxspectators.value + maxclients.value > MAX_CLIENTS) /* if (maxspectators.value + maxclients.value > MAX_CLIENTS)
CVAR_FIXME */ CVAR_FIXME */
if (maxspectators->value + maxclients->value > MAX_CLIENTS) if (maxspectators->value + maxclients->value > MAX_CLIENTS)
/* Cvar_SetValue ("maxspectators", MAX_CLIENTS - maxspectators.value + maxclients.value); /* Cvar_SetValue ("maxspectators", MAX_CLIENTS - maxspectators.value + maxclients.value);
CVAR_FIXME */ CVAR_FIXME */
maxspectators->value = MAX_CLIENTS - maxspectators->value + maxclients->value; Cvar_SetValue (maxspectators, MAX_CLIENTS - maxspectators->value + maxclients->value);
/* if ( (spectator && spectators >= (int)maxspectators.value) /* if ( (spectator && spectators >= (int)maxspectators.value)
CVAR_FIXME */ CVAR_FIXME */
if ( (spectator && spectators >= (int)maxspectators->value) if ( (spectator && spectators >= (int)maxspectators->value)

View file

@ -245,7 +245,7 @@ int main (int argc, char **argv)
if (COM_CheckParm ("-nopriority")) if (COM_CheckParm ("-nopriority"))
{ {
Cvar_Set ("sys_sleep", "0"); Cvar_Set (sys_sleep, "0");
} }
else else
{ {
@ -257,7 +257,7 @@ int main (int argc, char **argv)
// sys_sleep > 0 seems to cause packet loss on WinNT (why?) // sys_sleep > 0 seems to cause packet loss on WinNT (why?)
if (WinNT) if (WinNT)
Cvar_Set ("sys_sleep", "0"); Cvar_Set (sys_sleep, "0");
// run one frame immediately for first heartbeat // run one frame immediately for first heartbeat
SV_Frame (0.1); SV_Frame (0.1);

View file

@ -207,8 +207,8 @@ void VID_RememberWindowPos (void)
(rect.right > 0) && (rect.right > 0) &&
(rect.bottom > 0)) (rect.bottom > 0))
{ {
Cvar_SetValue ("vid_window_x", (float)rect.left); Cvar_SetValue (vid_window_x, (float)rect.left);
Cvar_SetValue ("vid_window_y", (float)rect.top); Cvar_SetValue (vid_window_y, (float)rect.top);
} }
} }
} }
@ -235,8 +235,8 @@ void VID_CheckWindowXY (void)
CVAR_FIXME */ CVAR_FIXME */
((int)vid_window_y->value < 0)) ((int)vid_window_y->value < 0))
{ {
Cvar_SetValue ("vid_window_x", 0.0); Cvar_SetValue (vid_window_x, 0.0);
Cvar_SetValue ("vid_window_y", 0.0 ); Cvar_SetValue (vid_window_y, 0.0 );
} }
} }
@ -1327,8 +1327,8 @@ qboolean VID_SetWindowedMode (int modenum)
{ {
if (COM_CheckParm ("-resetwinpos")) if (COM_CheckParm ("-resetwinpos"))
{ {
Cvar_SetValue ("vid_window_x", 0.0); Cvar_SetValue (vid_window_x, 0.0);
Cvar_SetValue ("vid_window_y", 0.0); Cvar_SetValue (vid_window_y, 0.0);
} }
windowed_mode_set; windowed_mode_set;
@ -1690,11 +1690,11 @@ int VID_SetMode (int modenum, unsigned char *palette)
modenum = vid_default; modenum = vid_default;
} }
Cvar_SetValue ("vid_mode", (float)modenum); Cvar_SetValue (vid_mode, (float)modenum);
} }
else else
{ {
Cvar_SetValue ("vid_mode", (float)vid_modenum); Cvar_SetValue (vid_mode, (float)vid_modenum);
return 0; return 0;
} }
} }
@ -1783,7 +1783,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
ReleaseDC(NULL,hdc); ReleaseDC(NULL,hdc);
vid_modenum = modenum; vid_modenum = modenum;
Cvar_SetValue ("vid_mode", (float)vid_modenum); Cvar_SetValue (vid_mode, (float)vid_modenum);
if (!VID_AllocBuffers (vid.width, vid.height)) if (!VID_AllocBuffers (vid.width, vid.height))
{ {
@ -2478,8 +2478,8 @@ void VID_Update (vrect_t *rects)
{ {
if (COM_CheckParm ("-resetwinpos")) if (COM_CheckParm ("-resetwinpos"))
{ {
Cvar_SetValue ("vid_window_x", 0.0); Cvar_SetValue (vid_window_x, 0.0);
Cvar_SetValue ("vid_window_y", 0.0); Cvar_SetValue (vid_window_y, 0.0);
} }
VID_CheckWindowXY (); VID_CheckWindowXY ();
@ -2504,8 +2504,8 @@ void VID_Update (vrect_t *rects)
if (COM_CheckParm ("-resetwinpos")) if (COM_CheckParm ("-resetwinpos"))
{ {
Cvar_SetValue ("vid_window_x", 0.0); Cvar_SetValue (vid_window_x, 0.0);
Cvar_SetValue ("vid_window_y", 0.0); Cvar_SetValue (vid_window_y, 0.0);
} }
/* if ((_vid_default_mode_win.value < 0) || /* if ((_vid_default_mode_win.value < 0) ||
@ -2515,12 +2515,12 @@ void VID_Update (vrect_t *rects)
CVAR_FIXME */ CVAR_FIXME */
(_vid_default_mode_win->value >= nummodes)) (_vid_default_mode_win->value >= nummodes))
{ {
Cvar_SetValue ("_vid_default_mode_win", windowed_default); Cvar_SetValue (_vid_default_mode_win, windowed_default);
} }
/* Cvar_SetValue ("vid_mode", _vid_default_mode_win.value); /* Cvar_SetValue ("vid_mode", _vid_default_mode_win.value);
CVAR_FIXME */ CVAR_FIXME */
Cvar_SetValue ("vid_mode", _vid_default_mode_win->value); Cvar_SetValue (vid_mode, _vid_default_mode_win->value);
} }
} }
@ -2544,7 +2544,7 @@ void VID_Update (vrect_t *rects)
/* VID_SetMode ((int)vid_mode.value, vid_curpal); /* VID_SetMode ((int)vid_mode.value, vid_curpal);
CVAR_FIXME */ CVAR_FIXME */
VID_SetMode ((int)vid_mode->value, vid_curpal); VID_SetMode ((int)vid_mode->value, vid_curpal);
Cvar_SetValue ("vid_mode", (float)vid_modenum); Cvar_SetValue (vid_mode, (float)vid_modenum);
// so if mode set fails, we don't keep on // so if mode set fails, we don't keep on
// trying to set that mode // trying to set that mode
vid_realmode = vid_modenum; vid_realmode = vid_modenum;
@ -3522,7 +3522,7 @@ void VID_MenuKey (int key)
case 'd': case 'd':
S_LocalSound ("misc/menu1.wav"); S_LocalSound ("misc/menu1.wav");
firstupdate = 0; firstupdate = 0;
Cvar_SetValue ("_vid_default_mode_win", vid_modenum); Cvar_SetValue (_vid_default_mode_win, vid_modenum);
break; break;
default: default: