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;
@ -161,7 +160,7 @@ ApplyChanges(void *unused)
Cvar_SetValue("fov", 106);
}
}
if (restart)
{
Cbuf_AddText("vid_restart\n");
@ -307,8 +306,8 @@ VID_MenuInit(void)
s_aspect_list.generic.name = "aspect ratio";
s_aspect_list.generic.x = 0;
s_aspect_list.generic.y = 10;
s_aspect_list.itemnames = aspect_names;
s_aspect_list.itemnames = aspect_names;
s_screensize_slider.generic.type = MTYPE_SLIDER;
s_screensize_slider.generic.x = 0;
s_screensize_slider.generic.y = 20;
@ -333,7 +332,7 @@ VID_MenuInit(void)
s_fs_box.generic.name = "fullscreen";
s_fs_box.itemnames = yesno_names;
s_fs_box.curvalue = vid_fullscreen->value;
s_tq_slider.generic.type = MTYPE_SLIDER;
s_tq_slider.generic.x = 0;
s_tq_slider.generic.y = 70;
@ -341,14 +340,14 @@ VID_MenuInit(void)
s_tq_slider.minvalue = 0;
s_tq_slider.maxvalue = 3;
s_tq_slider.curvalue = 3 - gl_picmip->value;
s_paletted_texture_box.generic.type = MTYPE_SPINCONTROL;
s_paletted_texture_box.generic.x = 0;
s_paletted_texture_box.generic.y = 80;
s_paletted_texture_box.generic.name = "8-bit textures";
s_paletted_texture_box.itemnames = yesno_names;
s_paletted_texture_box.curvalue = gl_ext_palettedtexture->value;
s_defaults_action.generic.type = MTYPE_ACTION;
s_defaults_action.generic.name = "reset to default";
s_defaults_action.generic.x = 0;

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
@ -637,7 +636,7 @@ R_SetupFrame(void)
/* check above and below so crossing solid water doesn't draw wrong */
if (!leaf->contents)
{
{
/* look down a bit */
vec3_t temp;
@ -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)