mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
changed cvar callback functions to accept a cvar_t pointer arg. I may
have a use for that later. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@545 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
9af55c7482
commit
42e55b3377
9 changed files with 29 additions and 42 deletions
|
@ -353,7 +353,7 @@ void Cvar_Set (const char *var_name, const char *value)
|
||||||
|
|
||||||
//johnfitz
|
//johnfitz
|
||||||
if(var->callback && changed)
|
if(var->callback && changed)
|
||||||
var->callback();
|
var->callback(var);
|
||||||
//johnfitz
|
//johnfitz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ Cvars are restricted from having the same names as commands to keep this
|
||||||
interface from being ambiguous.
|
interface from being ambiguous.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef void (*cvarcallback_t) (void);
|
typedef void (*cvarcallback_t) (struct cvar_s *);
|
||||||
|
|
||||||
typedef struct cvar_s
|
typedef struct cvar_s
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,14 +53,13 @@ extern cvar_t gl_subdivide_size; //johnfitz -- moved here from gl_model.c
|
||||||
|
|
||||||
extern gltexture_t *playertextures[MAX_SCOREBOARD]; //johnfitz
|
extern gltexture_t *playertextures[MAX_SCOREBOARD]; //johnfitz
|
||||||
|
|
||||||
void R_NoLerpList_f (void); //johnfitz
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
====================
|
====================
|
||||||
GL_Overbright_f -- johnfitz
|
GL_Overbright_f -- johnfitz
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void GL_Overbright_f (void)
|
static void GL_Overbright_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
R_RebuildAllLightmaps ();
|
R_RebuildAllLightmaps ();
|
||||||
}
|
}
|
||||||
|
@ -70,7 +69,7 @@ void GL_Overbright_f (void)
|
||||||
GL_Fullbrights_f -- johnfitz
|
GL_Fullbrights_f -- johnfitz
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void GL_Fullbrights_f (void)
|
static void GL_Fullbrights_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
TexMgr_ReloadNobrightImages ();
|
TexMgr_ReloadNobrightImages ();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +79,7 @@ void GL_Fullbrights_f (void)
|
||||||
R_SetClearColor_f -- johnfitz
|
R_SetClearColor_f -- johnfitz
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void R_SetClearColor_f (void)
|
static void R_SetClearColor_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
byte *rgb;
|
byte *rgb;
|
||||||
int s;
|
int s;
|
||||||
|
@ -95,21 +94,22 @@ void R_SetClearColor_f (void)
|
||||||
R_Novis_f -- johnfitz
|
R_Novis_f -- johnfitz
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void R_Novis_f (void)
|
static void R_VisChanged (cvar_t *var)
|
||||||
{
|
{
|
||||||
extern int vis_changed;
|
extern int vis_changed;
|
||||||
vis_changed = 1;
|
vis_changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
====================
|
===============
|
||||||
R_OldSkyLeaf_f -- johnfitz
|
R_NoLerpList_f -- johnfitz -- called when r_nolerp_list cvar changes
|
||||||
====================
|
===============
|
||||||
*/
|
*/
|
||||||
void R_OldSkyLeaf_f (void)
|
static void R_NoLerpList_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
extern int vis_changed;
|
int i;
|
||||||
vis_changed = 1;
|
for (i=0; i < MAX_MODELS; i++)
|
||||||
|
Mod_SetExtraFlags (cl.model_precache[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -207,7 +207,7 @@ void R_Init (void)
|
||||||
Cvar_RegisterVariable (&r_shadows, NULL);
|
Cvar_RegisterVariable (&r_shadows, NULL);
|
||||||
Cvar_RegisterVariable (&r_wateralpha, NULL);
|
Cvar_RegisterVariable (&r_wateralpha, NULL);
|
||||||
Cvar_RegisterVariable (&r_dynamic, NULL);
|
Cvar_RegisterVariable (&r_dynamic, NULL);
|
||||||
Cvar_RegisterVariable (&r_novis, R_Novis_f);
|
Cvar_RegisterVariable (&r_novis, R_VisChanged);
|
||||||
Cvar_RegisterVariable (&r_speeds, NULL);
|
Cvar_RegisterVariable (&r_speeds, NULL);
|
||||||
|
|
||||||
Cvar_RegisterVariable (&gl_finish, NULL);
|
Cvar_RegisterVariable (&gl_finish, NULL);
|
||||||
|
@ -229,7 +229,7 @@ void R_Init (void)
|
||||||
Cvar_RegisterVariable (&r_waterwarp, NULL);
|
Cvar_RegisterVariable (&r_waterwarp, NULL);
|
||||||
Cvar_RegisterVariable (&r_drawflat, NULL);
|
Cvar_RegisterVariable (&r_drawflat, NULL);
|
||||||
Cvar_RegisterVariable (&r_flatlightstyles, NULL);
|
Cvar_RegisterVariable (&r_flatlightstyles, NULL);
|
||||||
Cvar_RegisterVariable (&r_oldskyleaf, R_OldSkyLeaf_f);
|
Cvar_RegisterVariable (&r_oldskyleaf, R_VisChanged);
|
||||||
Cvar_RegisterVariable (&r_drawworld, NULL);
|
Cvar_RegisterVariable (&r_drawworld, NULL);
|
||||||
Cvar_RegisterVariable (&r_showtris, NULL);
|
Cvar_RegisterVariable (&r_showtris, NULL);
|
||||||
Cvar_RegisterVariable (&r_showbboxes, NULL);
|
Cvar_RegisterVariable (&r_showbboxes, NULL);
|
||||||
|
@ -247,25 +247,12 @@ void R_Init (void)
|
||||||
Cvar_RegisterVariable (&gl_subdivide_size, NULL); //johnfitz -- moved here from gl_model.c
|
Cvar_RegisterVariable (&gl_subdivide_size, NULL); //johnfitz -- moved here from gl_model.c
|
||||||
|
|
||||||
R_InitParticles ();
|
R_InitParticles ();
|
||||||
R_SetClearColor_f (); //johnfitz
|
R_SetClearColor_f (&r_clearcolor); //johnfitz
|
||||||
|
|
||||||
Sky_Init (); //johnfitz
|
Sky_Init (); //johnfitz
|
||||||
Fog_Init (); //johnfitz
|
Fog_Init (); //johnfitz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
R_NoLerpList_f -- johnfitz -- called when r_nolerp_list cvar changes
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void R_NoLerpList_f (void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i=0; i < MAX_MODELS; i++)
|
|
||||||
Mod_SetExtraFlags (cl.model_precache[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_TranslatePlayerSkin -- johnfitz -- rewritten. also, only handles new colors, not new skins
|
R_TranslatePlayerSkin -- johnfitz -- rewritten. also, only handles new colors, not new skins
|
||||||
|
|
|
@ -340,7 +340,7 @@ void SCR_SizeDown_f (void)
|
||||||
SCR_Conwidth_f -- johnfitz -- called when scr_conwidth or scr_conscale changes
|
SCR_Conwidth_f -- johnfitz -- called when scr_conwidth or scr_conscale changes
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
void SCR_Conwidth_f (void)
|
void SCR_Conwidth_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
vid.conwidth = (scr_conwidth.value > 0) ? (int)scr_conwidth.value : (scr_conscale.value > 0) ? (int)(vid.width/scr_conscale.value) : vid.width;
|
vid.conwidth = (scr_conwidth.value > 0) ? (int)scr_conwidth.value : (scr_conscale.value > 0) ? (int)(vid.width/scr_conscale.value) : vid.width;
|
||||||
vid.conwidth = CLAMP (320, vid.conwidth, vid.width);
|
vid.conwidth = CLAMP (320, vid.conwidth, vid.width);
|
||||||
|
|
|
@ -181,7 +181,7 @@ TexMgr_Anisotropy_f -- called when gl_texture_anisotropy changes
|
||||||
FIXME: this is getting called twice (becuase of the recursive Cvar_SetValue call)
|
FIXME: this is getting called twice (becuase of the recursive Cvar_SetValue call)
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void TexMgr_Anisotropy_f (void)
|
void TexMgr_Anisotropy_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
extern float gl_max_anisotropy;
|
extern float gl_max_anisotropy;
|
||||||
gltexture_t *glt;
|
gltexture_t *glt;
|
||||||
|
|
|
@ -237,7 +237,7 @@ void VID_Gamma_Shutdown (void)
|
||||||
VID_Gamma_f -- callback when the cvar changes
|
VID_Gamma_f -- callback when the cvar changes
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
void VID_Gamma_f (void)
|
void VID_Gamma_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
static float oldgamma;
|
static float oldgamma;
|
||||||
int i;
|
int i;
|
||||||
|
@ -627,7 +627,7 @@ int VID_SetMode (int modenum)
|
||||||
VID_Vsync_f -- johnfitz
|
VID_Vsync_f -- johnfitz
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void VID_Vsync_f (void)
|
void VID_Vsync_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
if (gl_swap_control)
|
if (gl_swap_control)
|
||||||
{
|
{
|
||||||
|
@ -790,7 +790,7 @@ void VID_Restart (void)
|
||||||
vid_canalttab = true;
|
vid_canalttab = true;
|
||||||
|
|
||||||
//swapcontrol settings were lost when previous window was destroyed
|
//swapcontrol settings were lost when previous window was destroyed
|
||||||
VID_Vsync_f ();
|
VID_Vsync_f (&vid_vsync);
|
||||||
|
|
||||||
//warpimages needs to be recalculated
|
//warpimages needs to be recalculated
|
||||||
TexMgr_RecalcWarpImageSize ();
|
TexMgr_RecalcWarpImageSize ();
|
||||||
|
|
|
@ -201,7 +201,7 @@ void VID_Gamma_Shutdown (void)
|
||||||
VID_Gamma_f -- callback when the cvar changes
|
VID_Gamma_f -- callback when the cvar changes
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
void VID_Gamma_f (void)
|
void VID_Gamma_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
static float oldgamma;
|
static float oldgamma;
|
||||||
int i;
|
int i;
|
||||||
|
@ -352,7 +352,7 @@ int VID_SetMode (int modenum)
|
||||||
VID_Changed_f -- kristian -- notify us that a value has changed that requires a vid_restart
|
VID_Changed_f -- kristian -- notify us that a value has changed that requires a vid_restart
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
void VID_Changed_f (void)
|
static void VID_Changed_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
vid_changed = true;
|
vid_changed = true;
|
||||||
}
|
}
|
||||||
|
|
10
Quake/host.c
10
Quake/host.c
|
@ -91,7 +91,7 @@ overflowtimes_t dev_overflows; //this stores the last time overflow messages wer
|
||||||
Max_Edicts_f -- johnfitz
|
Max_Edicts_f -- johnfitz
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
static void Max_Edicts_f (void)
|
static void Max_Edicts_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
static float oldval = DEF_EDICTS; //must match the default value for max_edicts
|
static float oldval = DEF_EDICTS; //must match the default value for max_edicts
|
||||||
|
|
||||||
|
@ -106,15 +106,15 @@ static void Max_Edicts_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1999-09-06 deathmatch/coop not at the same time fix by Maddes
|
// 1999-09-06 deathmatch/coop not at the same time fix by Maddes
|
||||||
static void Callback_Deathmatch (void)
|
static void Callback_Deathmatch (cvar_t *var)
|
||||||
{
|
{
|
||||||
if (deathmatch.value)
|
if (var->value)
|
||||||
Cvar_Set ("coop", "0");
|
Cvar_Set ("coop", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Callback_Coop (void)
|
static void Callback_Coop (cvar_t *var)
|
||||||
{
|
{
|
||||||
if (coop.value)
|
if (var->value)
|
||||||
Cvar_Set ("deathmatch", "0");
|
Cvar_Set ("deathmatch", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ void R_InitParticleTextures (void)
|
||||||
R_SetParticleTexture_f -- johnfitz
|
R_SetParticleTexture_f -- johnfitz
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_SetParticleTexture_f (void)
|
static void R_SetParticleTexture_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
switch ((int)(r_particles.value))
|
switch ((int)(r_particles.value))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue