[gl] Clean up some triple buffer and multi-texture cvar mess

Excess declarations for gl_multitexture_f, and move gl_triplebuffer into
a callback.
This commit is contained in:
Bill Currie 2022-03-07 08:38:38 +09:00
parent 1ea3a3807e
commit 71c1b4e0c4
4 changed files with 12 additions and 12 deletions

View file

@ -29,7 +29,9 @@
#define __QF_GL_rmain_h
#include "QF/qtypes.h"
#include "QF/cvar.h"
struct cvar_s;
struct entity_s;
extern qboolean gl_envmap;
extern int c_brush_polys, c_alias_polys;
@ -38,7 +40,7 @@ extern float r_world_matrix[16];
extern float gl_modelalpha;
//extern vec3_t shadecolor;
extern void gl_multitexture_f (cvar_t *var);
extern void gl_multitexture_f (struct cvar_s *var);
void glrmain_init (void);
void R_RotateForEntity (struct entity_s *e);

View file

@ -80,9 +80,6 @@ static int lmshift = 7;
void (*gl_R_BuildLightMap) (const transform_t *transform, mod_brush_t *brush,
msurface_t *surf);
extern void gl_multitexture_f (cvar_t *var);
void
gl_lightmap_init (void)
{

View file

@ -211,8 +211,6 @@ gl_R_RenderFrame (SCR_Func *scr_funcs)
begun = 0;
}
vid.numpages = 2 + gl_triplebuffer->int_val;
//FIXME forces the status bar to redraw. needed because it does not fully
//update in sw modes but must in gl mode
vr_data.scr_copyeverything = 1;
@ -223,8 +221,6 @@ gl_R_RenderFrame (SCR_Func *scr_funcs)
if (r_speeds->int_val) {
time1 = Sys_DoubleTime ();
gl_c_brush_polys = 0;
gl_c_alias_polys = 0;
}
// do 3D refresh drawing, and then update the screen

View file

@ -48,6 +48,7 @@
#include "QF/GL/defines.h"
#include "QF/GL/extensions.h"
#include "QF/GL/funcs.h"
#include "QF/GL/qf_rmain.h"
#include "QF/GL/qf_vid.h"
#include "compat.h"
@ -150,8 +151,11 @@ cvar_t *gl_texsort;
cvar_t *gl_triplebuffer;
static cvar_t *vid_use8bit;
void gl_multitexture_f (cvar_t *var);
static void
gl_triplebuffer_f (cvar_t *var)
{
vid.numpages = var->int_val ? 3 : 2;
}
static void
gl_max_size_f (cvar_t *var)
@ -401,7 +405,8 @@ GL_Common_Init_Cvars (void)
"controls whether the skydome is single or "
"double pass");
gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_NONE, NULL, "None");
gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL,
gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE,
gl_triplebuffer_f,
"Set to 1 by default. Fixes status bar "
"flicker on some hardware");
}