Remove vid_ref cvar

Normally setting gl_mode cvar would result in VID_LoadRefresh because
of vid_ref being "modified". After removing vid_ref out of the picture
it will "modify" vid_fullscreen to replicate the same behaviour.

Variable "name" (who used to hold refresh dll name) is now left unused

All references to vid_ref cvar has been taken out ...
This commit is contained in:
Alejandro Ricoveri 2013-04-29 16:37:55 -04:30 committed by Yamagi Burmeister
parent 35e1792c91
commit 8e69d9dc5c
4 changed files with 19 additions and 37 deletions

View file

@ -46,7 +46,6 @@ refexport_t re;
/* Console variables that we need to access from this module */
cvar_t *vid_gamma;
cvar_t *vid_ref; /* Name of Refresh DLL loaded */
cvar_t *vid_xpos; /* X coordinate of window position */
cvar_t *vid_ypos; /* Y coordinate of window position */
cvar_t *vid_fullscreen;
@ -98,14 +97,14 @@ VID_Error(int err_level, char *fmt, ...)
}
/*
* Console command to re-start the video mode and refresh DLL. We do this
* simply by setting the modified flag for the vid_ref variable, which will
* cause the entire video mode and refresh DLL to be reset on the next frame.
* Console command to re-start the video mode and refresh. We do this
* simply by setting the modified flag for the vid_fullscreen variable, which will
* cause the entire video mode and refreshto be reset on the next frame.
*/
void
VID_Restart_f(void)
{
vid_ref->modified = true;
vid_fullscreen->modified = true;
}
typedef struct vidmode_s
@ -192,7 +191,8 @@ VID_FreeReflib(void)
}
qboolean
VID_LoadRefresh(char *name)
//VID_LoadRefresh(char *name)
VID_LoadRefresh(void)
{
refimport_t ri; // Refresh imported functions
@ -268,34 +268,24 @@ VID_LoadRefresh(char *name)
/*
* This function gets called once just before drawing each frame, and
* it's sole purpose in life is to check to see if any of the video mode
* parameters have changed, and if they have to update the rendering DLL
* parameters have changed, and if they have to update the refresh
* and/or video mode to match.
*/
void
VID_CheckChanges(void)
{
char name[100];
if (vid_ref->modified)
if (vid_fullscreen->modified)
{
S_StopAllSounds();
}
while (vid_ref->modified)
{
/* refresh has changed */
vid_ref->modified = false;
vid_fullscreen->modified = true;
cl.refresh_prepped = false;
cl.cinematicpalette_active = false;
cls.disable_screen = true;
// Proceed to reboot the refresher
if (!VID_LoadRefresh(name))
{
Cvar_Set("vid_ref", "gl");
}
VID_LoadRefresh();
cls.disable_screen = false;
}
}
@ -304,8 +294,6 @@ void
VID_Init(void)
{
/* Create the video variables so we know how to start the graphics drivers */
vid_ref = Cvar_Get("vid_ref", "gl", CVAR_ARCHIVE);
vid_xpos = Cvar_Get("vid_xpos", "3", CVAR_ARCHIVE);
vid_ypos = Cvar_Get("vid_ypos", "22", CVAR_ARCHIVE);
vid_fullscreen = Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);

View file

@ -32,7 +32,6 @@
extern void M_ForceMenuOff(void);
extern cvar_t *vid_ref;
extern cvar_t *vid_fullscreen;
extern cvar_t *vid_gamma;
extern cvar_t *scr_viewsize;

View file

@ -276,7 +276,7 @@ Cbuf_AddEarlyCommands(qboolean clear)
/*
* Adds command line parameters as script statements
* Commands lead with a + and continue until another + or -
* quake +vid_ref gl +map amlev1
* quake +developer 1 +map amlev1
*
* Returns true if any late commands were added, which
* will keep the demoloop from immediately starting

View file

@ -164,7 +164,6 @@ cvar_t *gl_lockpvs;
cvar_t *vid_fullscreen;
cvar_t *vid_gamma;
cvar_t *vid_ref;
/*
* Returns true if the box is completely outside the frustom
@ -1037,7 +1036,6 @@ R_Register(void)
vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", CVAR_ARCHIVE);
vid_ref = ri.Cvar_Get("vid_ref", "soft", CVAR_ARCHIVE);
gl_customwidth = ri.Cvar_Get("gl_customwidth", "1024", CVAR_ARCHIVE);
gl_customheight = ri.Cvar_Get("gl_customheight", "768", CVAR_ARCHIVE);
@ -1395,12 +1393,9 @@ R_BeginFrame(float camera_separation)
gl_state.camera_separation = camera_separation;
/* change modes if necessary */
if (gl_mode->modified || vid_fullscreen->modified)
if (gl_mode->modified)
{
cvar_t *ref;
ref = ri.Cvar_Get("vid_ref", "gl", 0);
ref->modified = true;
vid_fullscreen->modified = true;
}
if (gl_log->modified)