mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-14 00:40:55 +00:00
12c84046f3
This is an extremely extensive patch as it hits every cvar, and every usage of the cvars. Cvars no longer store the value they control, instead, they use a cexpr value object to reference the value and specify the value's type (currently, a null type is used for strings). Non-string cvars are passed through cexpr, allowing expressions in the cvars' settings. Also, cvars have returned to an enhanced version of the original (id quake) registration scheme. As a minor benefit, relevant code having direct access to the cvar-controlled variables is probably a slight optimization as it removed a pointer dereference, and the variables can be located for data locality. The static cvar descriptors are made private as an additional safety layer, though there's nothing stopping external modification via Cvar_FindVar (which is needed for adding listeners). While not used yet (partly due to working out the design), cvars can have a validation function. Registering a cvar allows a primary listener (and its data) to be specified: it will always be called first when the cvar is modified. The combination of proper listeners and direct access to the controlled variable greatly simplifies the more complex cvar interactions as much less null checking is required, and there's no need for one cvar's callback to call another's. nq-x11 is known to work at least well enough for the demos. More testing will come.
92 lines
2.2 KiB
C
92 lines
2.2 KiB
C
#include "QF/mathlib.h"
|
|
|
|
extern void gl_overbright_f (void *data, const struct cvar_s *cvar);
|
|
|
|
extern int cl_crossx;
|
|
extern int cl_crossy;
|
|
extern char *cl_verstring;
|
|
extern int crosshair;
|
|
extern int crosshaircolor;
|
|
extern quat_t crosshair_color;
|
|
|
|
extern float d_mipcap;
|
|
extern float d_mipscale;
|
|
|
|
extern int gl_affinemodels;
|
|
extern float gl_anisotropy;
|
|
extern int gl_clear;
|
|
extern float gl_conspin;
|
|
extern int gl_constretch;
|
|
extern int gl_dlight_polyblend;
|
|
extern int gl_dlight_smooth;
|
|
extern int gl_fb_bmodels;
|
|
extern int gl_fb_models;
|
|
extern int gl_finish;
|
|
extern int gl_keeptjunctions;
|
|
extern int gl_lerp_anim;
|
|
extern int gl_lightmap_align;
|
|
extern int gl_lightmap_subimage;
|
|
extern int gl_max_size;
|
|
extern int gl_multitexture;
|
|
extern int gl_nocolors;
|
|
extern int gl_overbright;
|
|
extern int gl_particle_mip;
|
|
extern int gl_particle_size;
|
|
extern int gl_picmip;
|
|
extern int gl_playermip;
|
|
extern int gl_reporttjunctions;
|
|
extern int gl_sky_clip;
|
|
extern int gl_sky_debug;
|
|
extern int gl_sky_multipass;
|
|
extern int gl_tessellate;
|
|
extern int gl_texsort;
|
|
extern int gl_textures_bgra;
|
|
extern int gl_triplebuffer;
|
|
extern int gl_vector_light;
|
|
|
|
extern int r_aliasstats;
|
|
extern float r_aliastransadj;
|
|
extern float r_aliastransbase;
|
|
extern int r_clearcolor;
|
|
extern int r_dlight_lightmap;
|
|
extern int r_drawentities;
|
|
extern int r_drawexplosions;
|
|
extern int r_drawviewmodel;
|
|
extern int r_dspeeds;
|
|
extern int r_dynamic;
|
|
extern int r_explosionclip;
|
|
extern float r_farclip;
|
|
extern vec4f_t r_firecolor;
|
|
extern int r_flatlightstyles;
|
|
extern int r_graphheight;
|
|
extern int r_lightmap_components;
|
|
extern int r_maxedges;
|
|
extern int r_maxsurfs;
|
|
extern float r_mirroralpha;
|
|
extern float r_nearclip;
|
|
extern int r_norefresh;
|
|
extern int r_novis;
|
|
extern int r_numedges;
|
|
extern int r_numsurfs;
|
|
extern int r_particles;
|
|
extern int r_particles_max;
|
|
extern float r_particles_nearclip;
|
|
extern int r_reportedgeout;
|
|
extern int r_reportsurfout;
|
|
extern int r_shadows;
|
|
extern char *r_skyname;
|
|
extern int r_speeds;
|
|
extern int r_timegraph;
|
|
extern float r_wateralpha;
|
|
extern float r_waterripple;
|
|
extern int r_waterwarp;
|
|
extern int r_zgraph;
|
|
|
|
extern float scr_fov;
|
|
extern int scr_fisheye;
|
|
extern int scr_fviews;
|
|
extern float scr_ffov;
|
|
extern int scr_showpause;
|
|
extern int scr_showram;
|
|
extern int scr_showturtle;
|
|
extern int scr_viewsize;
|