vid_wait aliased to _vid_wait_override properly, command completion will now show renamed cvars (like mapname, host_setspeed, vid_wait) correctly
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2228 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
bd3cab06a3
commit
0cc2ba719c
5 changed files with 23 additions and 19 deletions
|
@ -76,7 +76,7 @@ cvar_t cl_predict_players2 = SCVAR("cl_predict_players2", "1");
|
|||
cvar_t cl_solid_players = SCVAR("cl_solid_players", "1");
|
||||
cvar_t cl_noblink = SCVAR("cl_noblink", "0");
|
||||
|
||||
cvar_t cl_demospeed = SCVAR("cl_demospeed", "1");
|
||||
cvar_t cl_demospeed = FCVAR("cl_demospeed", "demo_setspeed", "1", 0);
|
||||
|
||||
|
||||
cvar_t cl_indepphysics = SCVAR("cl_indepphysics", "0");
|
||||
|
@ -130,7 +130,7 @@ cvar_t msg_filter = SCVAR("msg_filter", "0"); //0 for neither, 1 for mm1, 2 for
|
|||
cvar_t cl_standardmsg = SCVARF("cl_standardmsg", "0", CVAR_ARCHIVE);
|
||||
cvar_t cl_parsewhitetext = SCVAR("cl_parsewhitetext", "1");
|
||||
|
||||
cvar_t host_mapname = SCVAR("host_mapname", "");
|
||||
cvar_t host_mapname = FCVAR("host_mapname", "mapname", "", 0);
|
||||
|
||||
extern cvar_t cl_hightrack;
|
||||
|
||||
|
@ -2585,7 +2585,6 @@ void CL_Init (void)
|
|||
|
||||
Cvar_Register (&cfg_save_name, cl_controlgroup);
|
||||
|
||||
cl_demospeed.name2 = "demo_setspeed";
|
||||
Cvar_Register (&cl_demospeed, "Demo playback");
|
||||
Cvar_Register (&cl_warncmd, "Warnings");
|
||||
Cvar_Register (&cl_upspeed, cl_inputgroup);
|
||||
|
@ -2674,7 +2673,6 @@ void CL_Init (void)
|
|||
Cvar_Register (&cl_nopext, cl_controlgroup);
|
||||
Cvar_Register (&cl_splitscreen, cl_controlgroup);
|
||||
|
||||
host_mapname.name2 = "mapname";
|
||||
Cvar_Register (&host_mapname, "Scripting");
|
||||
|
||||
Cvar_Register (&cl_countpendingpl, cl_controlgroup);
|
||||
|
|
|
@ -86,8 +86,7 @@ cvar_t r_stainfadetime = SCVAR("r_stainfadetime", "1");
|
|||
cvar_t r_stainfadeammount = SCVAR("r_stainfadeammount", "1");
|
||||
|
||||
cvar_t _windowed_mouse = SCVARF("_windowed_mouse","1", CVAR_ARCHIVE);
|
||||
cvar_t vid_wait = SCVAR("vid_wait","0");
|
||||
cvar_t _vid_wait_override = SCVARF("_vid_wait_override", "", CVAR_ARCHIVE);
|
||||
cvar_t _vid_wait_override = FCVAR("vid_wait", "_vid_wait_override", "", CVAR_ARCHIVE);
|
||||
|
||||
static cvar_t vid_stretch = SCVARF("vid_stretch","1", CVAR_ARCHIVE|CVAR_RENDERERLATCH);
|
||||
//cvar_t _windowed_mouse = SCVARF("_windowed_mouse","1", CVAR_ARCHIVE);
|
||||
|
@ -480,8 +479,6 @@ void Renderer_Init(void)
|
|||
#endif
|
||||
|
||||
//but register ALL vid_ commands.
|
||||
Cvar_Register (&vid_wait, VIDCOMMANDGROUP);
|
||||
_vid_wait_override.name2 = "vid_vsync";
|
||||
Cvar_Register (&_vid_wait_override, VIDCOMMANDGROUP);
|
||||
Cvar_Register (&vid_stretch, VIDCOMMANDGROUP);
|
||||
Cvar_Register (&_windowed_mouse, VIDCOMMANDGROUP);
|
||||
|
|
|
@ -1536,8 +1536,12 @@ char *Cmd_CompleteCommand (char *partial, qboolean fullonly, qboolean caseinsens
|
|||
Cmd_CompleteCheck(a->name, &match);
|
||||
for (grp=cvar_groups ; grp ; grp=grp->next)
|
||||
for (cvar=grp->cvars ; cvar ; cvar=cvar->next)
|
||||
{
|
||||
if (!Q_strncasecmp (partial,cvar->name, len))
|
||||
Cmd_CompleteCheck(cvar->name, &match);
|
||||
if (cvar->name2 && !Q_strncasecmp (partial,cvar->name2, len))
|
||||
Cmd_CompleteCheck(cvar->name2, &match);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -1550,8 +1554,12 @@ char *Cmd_CompleteCommand (char *partial, qboolean fullonly, qboolean caseinsens
|
|||
Cmd_CompleteCheck(a->name, &match);
|
||||
for (grp=cvar_groups ; grp ; grp=grp->next)
|
||||
for (cvar=grp->cvars ; cvar ; cvar=cvar->next)
|
||||
{
|
||||
if (!Q_strncmp (partial,cvar->name, len))
|
||||
Cmd_CompleteCheck(cvar->name, &match);
|
||||
if (cvar->name2 && !Q_strncmp (partial,cvar->name2, len))
|
||||
Cmd_CompleteCheck(cvar->name2, &match);
|
||||
}
|
||||
}
|
||||
if (match.matchnum>0)
|
||||
return NULL;
|
||||
|
|
|
@ -89,13 +89,12 @@ cvar_t *Cvar_FindVar (const char *var_name)
|
|||
|
||||
for (grp=cvar_groups ; grp ; grp=grp->next)
|
||||
for (var=grp->cvars ; var ; var=var->next)
|
||||
{
|
||||
if (!Q_strcasecmp (var_name, var->name))
|
||||
return var;
|
||||
|
||||
for (grp=cvar_groups ; grp ; grp=grp->next)
|
||||
for (var=grp->cvars ; var ; var=var->next)
|
||||
if (var->name2 && !Q_strcasecmp (var_name, var->name2))
|
||||
return var;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,6 @@ qboolean isPermedia = false;
|
|||
// Note that 0 is MODE_WINDOWED
|
||||
extern cvar_t vid_mode;
|
||||
// Note that 3 is MODE_FULLSCREEN_DEFAULT
|
||||
extern cvar_t vid_wait;
|
||||
extern cvar_t _vid_wait_override;
|
||||
extern cvar_t _windowed_mouse;
|
||||
extern cvar_t vid_hardwaregamma;
|
||||
|
@ -855,7 +854,6 @@ qboolean VID_AttachGL (rendererstate_t *info)
|
|||
TRACE(("dbg: VID_AttachGL: qwglSwapIntervalEXT\n"));
|
||||
qwglSwapIntervalEXT(_vid_wait_override.value);
|
||||
}
|
||||
_vid_wait_override.modified = false;
|
||||
TRACE(("dbg: VID_AttachGL: qSwapBuffers\n"));
|
||||
qglClearColor(0, 0, 0, 0);
|
||||
qglClear(GL_COLOR_BUFFER_BIT);
|
||||
|
@ -885,6 +883,12 @@ void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
|||
// glViewport (*x, *y, *width, *height);
|
||||
}
|
||||
|
||||
void VID_Wait_Override_Callback(struct cvar_s *var, char *oldvalue)
|
||||
{
|
||||
if (qwglSwapIntervalEXT && *_vid_wait_override.string)
|
||||
qwglSwapIntervalEXT(_vid_wait_override.value);
|
||||
}
|
||||
|
||||
qboolean screenflush;
|
||||
void GL_DoSwap (void)
|
||||
{
|
||||
|
@ -896,12 +900,6 @@ void GL_DoSwap (void)
|
|||
if (!scr_skipupdate || block_drawing)
|
||||
qSwapBuffers(maindc);
|
||||
|
||||
if (_vid_wait_override.modified && qwglSwapIntervalEXT && *_vid_wait_override.string)
|
||||
{
|
||||
qwglSwapIntervalEXT(_vid_wait_override.value);
|
||||
_vid_wait_override.modified = false;
|
||||
}
|
||||
|
||||
// handle the mouse state when windowed if that's changed
|
||||
if (modestate == MS_WINDOWED)
|
||||
{
|
||||
|
@ -1542,6 +1540,8 @@ void GLVID_DeInit (void)
|
|||
{
|
||||
GLVID_Shutdown();
|
||||
|
||||
Cvar_Unhook(&_vid_wait_override);
|
||||
|
||||
UnregisterClass(WINDOW_CLASS_NAME, global_hInstance);
|
||||
}
|
||||
/*
|
||||
|
@ -1603,6 +1603,8 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
|||
|
||||
S_Restart_f();
|
||||
|
||||
Cvar_Hook(&_vid_wait_override, VID_Wait_Override_Callback);
|
||||
|
||||
vid_initialized = true;
|
||||
vid_initializing = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue