From 4ff86056dbfef495f2ff54030fef5b8b2bc07ec3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 11 May 2001 19:21:48 +0000 Subject: [PATCH] pull all rendering cvar declarations and initialisations out of the misc files and put them into r_cvar.[ch] getting ready for the renderer merge --- nq/include/r_cvar.h | 77 ++++++++++ nq/source/Makefile.am | 2 +- nq/source/d_init.c | 9 +- nq/source/draw.c | 13 +- nq/source/gl_draw.c | 48 +----- nq/source/gl_rmain.c | 33 ---- nq/source/gl_rmisc.c | 52 ------- nq/source/gl_rsurf.c | 7 +- nq/source/gl_screen.c | 36 +---- nq/source/host.c | 4 +- nq/source/r_cvar.c | 186 +++++++++++++++++++++++ nq/source/screen.c | 34 +---- nq/source/sw_rmain.c | 53 +------ nq/source/sw_rpart.c | 2 +- nq/source/sw_rsurf.c | 5 + qw/include/r_cvar.h | 75 ++++++++++ qw/source/Makefile.am | 2 +- qw/source/cl_main.c | 2 - qw/source/d_init.c | 16 +- qw/source/draw.c | 6 - qw/source/gl_draw.c | 49 +----- qw/source/gl_rmain.c | 29 +--- qw/source/gl_rmisc.c | 41 ----- qw/source/gl_rsurf.c | 5 +- qw/source/gl_screen.c | 36 +---- qw/source/r_cvar.c | 341 ++++++++++++++++++++++++++++++++++++++++++ qw/source/screen.c | 34 +---- qw/source/sw_rmain.c | 63 +------- qw/source/sw_rsurf.c | 5 + 29 files changed, 708 insertions(+), 557 deletions(-) create mode 100644 nq/include/r_cvar.h create mode 100644 nq/source/r_cvar.c create mode 100644 qw/include/r_cvar.h create mode 100644 qw/source/r_cvar.c diff --git a/nq/include/r_cvar.h b/nq/include/r_cvar.h new file mode 100644 index 000000000..4e758bd01 --- /dev/null +++ b/nq/include/r_cvar.h @@ -0,0 +1,77 @@ +extern cvar_t *cl_crossx; +extern cvar_t *cl_crossy; +extern cvar_t *cl_verstring; +extern cvar_t *crosshair; +extern cvar_t *crosshaircolor; + +extern cvar_t *d_mipcap; +extern cvar_t *d_mipscale; +extern cvar_t *d_subdiv16; + +extern cvar_t *gl_affinemodels; +extern cvar_t *gl_clear; +extern cvar_t *gl_colorlights; +extern cvar_t *gl_conalpha; +extern cvar_t *gl_conspin; +extern cvar_t *gl_constretch; +extern cvar_t *gl_cull; +extern cvar_t *gl_fb_bmodels; +extern cvar_t *gl_fb_models; +extern cvar_t *gl_fires; +extern cvar_t *gl_flashblend; +extern cvar_t *gl_keeptjunctions; +extern cvar_t *gl_lightmap_components; +extern cvar_t *gl_lightmode; +extern cvar_t *gl_max_size; +extern cvar_t *gl_nocolors; +extern cvar_t *gl_picmip; +extern cvar_t *gl_playermip; +extern cvar_t *gl_polyblend; +extern cvar_t *gl_reporttjunctions; +extern cvar_t *gl_skymultipass; +extern cvar_t *gl_smoothmodels; +extern cvar_t *gl_texsort; +extern cvar_t *gl_triplebuffer; + +extern cvar_t *r_aliasstats; +extern cvar_t *r_aliastransadj; +extern cvar_t *r_aliastransbase; +extern cvar_t *r_ambient; +extern cvar_t *r_clearcolor; +extern cvar_t *r_drawentities; +extern cvar_t *r_drawflat; +extern cvar_t *r_draworder; +extern cvar_t *r_drawviewmodel; +extern cvar_t *r_dspeeds; +extern cvar_t *r_dynamic; +extern cvar_t *r_fullbright; +extern cvar_t *r_graphheight; +extern cvar_t *r_lightmap; +extern cvar_t *r_maxedges; +extern cvar_t *r_maxsurfs; +extern cvar_t *r_mirroralpha; +extern cvar_t *r_netgraph; +extern cvar_t *r_norefresh; +extern cvar_t *r_novis; +extern cvar_t *r_numedges; +extern cvar_t *r_numsurfs; +extern cvar_t *r_particles; +extern cvar_t *r_reportedgeout; +extern cvar_t *r_reportsurfout; +extern cvar_t *r_shadows; +extern cvar_t *r_skyname; +extern cvar_t *r_speeds; +extern cvar_t *r_timegraph; +extern cvar_t *r_wateralpha; +extern cvar_t *r_waterripple; +extern cvar_t *r_waterwarp; + +extern cvar_t *scr_centertime; +extern cvar_t *scr_consize; +extern cvar_t *scr_conspeed; +extern cvar_t *scr_fov; +extern cvar_t *scr_printspeed; +extern cvar_t *scr_showpause; +extern cvar_t *scr_showram; +extern cvar_t *scr_showturtle; +extern cvar_t *scr_viewsize; diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index 4c47b1705..7c7f1d514 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -71,7 +71,7 @@ client_LIB_DEPS= libqfnet.a client_POST_LIBS= $(top_builddir)/libs/video/targets/libQFjs.la client_SOURCES= cl_cam.c cl_cmd.c cl_demo.c cl_input.c cl_main.c cl_parse.c \ - cl_tent.c console.c keys.c sbar.c r_efrag.c r_part.c r_view.c \ + cl_tent.c console.c keys.c sbar.c r_cvar.c r_efrag.c r_part.c r_view.c \ nonintel.c gib.c gib_instructions.c gib_vars.c \ gib_interpret.c gib_modules.c gib_parse.c gib_stack.c \ pcx.c tga.c diff --git a/nq/source/d_init.c b/nq/source/d_init.c index 29bbf137f..31cf258fb 100644 --- a/nq/source/d_init.c +++ b/nq/source/d_init.c @@ -33,14 +33,11 @@ #include "QF/cvar.h" #include "d_local.h" +#include "r_cvar.h" #include "render.h" #define NUM_MIPS 4 -cvar_t *d_subdiv16; -cvar_t *d_mipcap; -cvar_t *d_mipscale; - surfcache_t *d_initial_rover; qboolean d_roverwrapped; int d_minmip; @@ -64,10 +61,6 @@ D_Init (void) r_skydirect = 1; - d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, "None"); - d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, "None"); - d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, "None"); - r_drawpolys = false; r_worldpolysbacktofront = false; r_recursiveaffinetriangles = true; diff --git a/nq/source/draw.c b/nq/source/draw.c index ad441b93c..d9607b8ff 100644 --- a/nq/source/draw.c +++ b/nq/source/draw.c @@ -44,6 +44,7 @@ #include "client.h" #include "d_iface.h" +#include "r_cvar.h" typedef struct { vrect_t rect; @@ -59,8 +60,6 @@ byte *draw_chars; // 8*8 graphic characters qpic_t *draw_disc; qpic_t *draw_backtile; -cvar_t *cl_verstring; - //============================================================================= /* Support Routines */ @@ -195,16 +194,6 @@ Draw_Init (void) r_rectdesc.height = draw_backtile->height; r_rectdesc.ptexbytes = draw_backtile->data; r_rectdesc.rowbytes = draw_backtile->width; - - cl_verstring = - Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, - "Client version string"); -} - - -void -Draw_Init_Cvars (void) -{ } diff --git a/nq/source/gl_draw.c b/nq/source/gl_draw.c index 8764c7a48..b77cef8e0 100644 --- a/nq/source/gl_draw.c +++ b/nq/source/gl_draw.c @@ -48,20 +48,13 @@ #include "client.h" #include "glquake.h" +#include "r_cvar.h" #include "sbar.h" extern byte *vid_basepal; extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor, *gl_lightmap_components; -cvar_t *gl_max_size; -cvar_t *gl_picmip; - -cvar_t *gl_constretch; -cvar_t *gl_conalpha; -cvar_t *gl_conspin; -cvar_t *cl_verstring; -cvar_t *gl_lightmode; // LordHavoc: lighting mode byte *draw_chars; // 8*8 graphic characters qpic_t *draw_disc; @@ -251,22 +244,6 @@ Draw_TextBox (int x, int y, int width, int lines) extern void glrmain_init (void); extern void glrsurf_init (void); extern void GL_TextureMode_f (void); -extern void R_ForceLightUpdate (void); - -void -gl_lightmode_callback (cvar_t *cvar) -{ - if (cvar->int_val) { - lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 128; - lighthalf = 1; - } else { - lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 255; - lighthalf = 0; - } - - R_ForceLightUpdate (); -} - void Draw_Init (void) @@ -284,8 +261,6 @@ Draw_Init (void) Cvar_Set (gl_lightmode, "0"); } - gl_lightmode_callback(gl_lightmode); - Cmd_AddCommand ("gl_texturemode", &GL_TextureMode_f, "Texture mipmap quality."); // load the console background and the charset @@ -317,27 +292,6 @@ Draw_Init (void) } -void -Draw_Init_Cvars (void) -{ - gl_lightmode = Cvar_Get ("gl_lightmode", "1", CVAR_ARCHIVE, - gl_lightmode_callback, - "Lighting mode (0 = GLQuake style, 1 = new style)"); - gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "Texture dimension"); - gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, NULL, "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); - gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, - "whether slide the console or stretch it"); - gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, - "alpha value for the console background"); - gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, - "speed at which the console spins"); - gl_lightmap_components = Cvar_Get ("gl_lightmap_components", "4", CVAR_ROM, - NULL, "Lightmap texture components. 1 is greyscale, 3 is RGB, 4 is RGBA."); - cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, - NULL, "Client version string"); -} - - /* Draw_Character8 diff --git a/nq/source/gl_rmain.c b/nq/source/gl_rmain.c index 4a3ca216f..4901c4b88 100644 --- a/nq/source/gl_rmain.c +++ b/nq/source/gl_rmain.c @@ -103,39 +103,6 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value void R_MarkLeaves (void); -cvar_t *r_norefresh; -cvar_t *r_drawentities; -cvar_t *r_drawviewmodel; -cvar_t *r_speeds; -cvar_t *r_fullbright; -cvar_t *r_lightmap; -cvar_t *r_shadows; -cvar_t *r_mirroralpha; -cvar_t *r_wateralpha; -cvar_t *r_waterripple; -cvar_t *r_dynamic; -cvar_t *r_novis; -cvar_t *r_netgraph; - -cvar_t *gl_clear; -cvar_t *gl_cull; -cvar_t *gl_texsort; -cvar_t *gl_smoothmodels; -cvar_t *gl_affinemodels; -cvar_t *gl_polyblend; -cvar_t *gl_flashblend; -cvar_t *gl_playermip; -cvar_t *gl_nocolors; -cvar_t *gl_keeptjunctions; -cvar_t *gl_reporttjunctions; -cvar_t *r_particles; - -cvar_t *r_skyname; -cvar_t *gl_skymultipass; - -cvar_t *gl_fb_models; -cvar_t *gl_fb_bmodels; - extern cvar_t *scr_fov; extern byte gammatable[256]; diff --git a/nq/source/gl_rmisc.c b/nq/source/gl_rmisc.c index ee91ec4fa..85da0846a 100644 --- a/nq/source/gl_rmisc.c +++ b/nq/source/gl_rmisc.c @@ -66,7 +66,6 @@ varray_t2f_c4f_v3f_t varray[MAX_VARRAY_VERTS]; qboolean VID_Is8bit (void); void R_InitBubble (); -cvar_t *gl_fires; qboolean allowskybox; // allow skyboxes? --KB @@ -190,56 +189,6 @@ R_Init (void) Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "No Description"); Cmd_AddCommand ("loadsky", R_LoadSky_f, "No Description"); - r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, "None"); - r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_NONE, NULL, "None"); - r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, NULL, "None"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "None"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, NULL, - "None"); - r_shadows = Cvar_Get ("r_shadows", "0", CVAR_NONE, NULL, "None"); - r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_NONE, NULL, "None"); - r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, "None"); - r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, "None"); - r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, "None"); - r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, "None"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "None"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, "None"); - - gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, "None"); - gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_NONE, NULL, "None"); - - gl_cull = Cvar_Get ("gl_cull", "1", CVAR_NONE, NULL, "None"); - gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_NONE, NULL, - "None"); - gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_NONE, NULL, - "None"); - gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_NONE, NULL, "None"); - gl_flashblend = Cvar_Get ("gl_flashblend", "0", CVAR_NONE, NULL, "None"); - gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, "None"); - gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, "None"); - - gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, - "Toggles lavaball and rocket fireballs"); - - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, - "whether or not to draw particles"); - - gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, - "Toggles fullbright color support for models.. " - "This is very handy, but costs me 2 FPS.. (=:]"); - gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, - "Toggles fullbright color support for bmodels"); - - gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_NONE, NULL, - "None"); - gl_reporttjunctions = - Cvar_Get ("gl_reporttjunctions", "0", CVAR_NONE, NULL, "None"); - - r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, - "name of the current skybox"); - gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_NONE, NULL, - "controls wether the skydome is single or double pass"); - R_InitBubble (); GDT_Init (); @@ -403,7 +352,6 @@ void R_NewMap (void) { int i; - cvar_t *r_skyname; for (i = 0; i < 256; i++) d_lightstylevalue[i] = 264; // normal light value diff --git a/nq/source/gl_rsurf.c b/nq/source/gl_rsurf.c index b5214321e..c4fef0b81 100644 --- a/nq/source/gl_rsurf.c +++ b/nq/source/gl_rsurf.c @@ -55,6 +55,7 @@ #include "protocol.h" #include "client.h" #include "glquake.h" +#include "r_cvar.h" #include "r_local.h" #include "render.h" #include "sbar.h" @@ -69,9 +70,6 @@ int lightmap_textures; unsigned blocklights[18 * 18 * 3]; -cvar_t *gl_colorlights; -cvar_t *gl_lightmap_components; - #define BLOCK_WIDTH 128 #define BLOCK_HEIGHT 128 @@ -1211,9 +1209,6 @@ GL_BuildLightmaps (void) texture_extension_number += MAX_LIGHTMAPS; } - gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, NULL, - "Whether to use RGB lightmaps or not"); - if (gl_colorlights->int_val) { gl_lightmap_format = GL_RGB; lightmap_bytes = 3; diff --git a/nq/source/gl_screen.c b/nq/source/gl_screen.c index 701a881c9..1ef30c08f 100644 --- a/nq/source/gl_screen.c +++ b/nq/source/gl_screen.c @@ -52,6 +52,7 @@ #include "client.h" #include "glquake.h" #include "host.h" +#include "r_cvar.h" #include "r_local.h" #include "sbar.h" #include "view.h" @@ -116,20 +117,6 @@ float scr_conlines; // lines of console to display int oldscreensize, oldfov; int oldsbar; -cvar_t *scr_viewsize; -cvar_t *scr_fov; // 10 - 170 -cvar_t *scr_conspeed; -cvar_t *scr_consize; -cvar_t *scr_centertime; -cvar_t *scr_showram; -cvar_t *scr_showturtle; -cvar_t *scr_showpause; -cvar_t *scr_printspeed; -cvar_t *gl_triplebuffer; -cvar_t *crosshair; -cvar_t *crosshaircolor; -cvar_t *cl_crossx; -cvar_t *cl_crossy; qboolean scr_initialized; // ready to draw @@ -388,27 +375,6 @@ SCR_SizeDown_f (void) //============================================================================ -void -SCR_Init_Cvars (void) -{ - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "Your point of view in degrees. Smaller than 90 zooms in."); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly console scrolls up or down"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show RAM icon if game is running low on memory"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show a turtle icon if your fps is slower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Toggles display of pause graphic"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds screen hints are displayed"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); - gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, "Set to 1 by default. Fixes status bar flicker on some hardware"); - - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Color of the new crosshair"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old without color, 2 new with colors"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis."); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); -} - - void SCR_Init (void) { diff --git a/nq/source/host.c b/nq/source/host.c index f5c866c79..65139c8ca 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -56,6 +56,7 @@ #include "view.h" extern void R_Particles_Init_Cvars (void); +extern void R_Init_Cvars (void); /* @@ -885,12 +886,11 @@ Host_Init (quakeparms_t *parms) IN_Init_Cvars (); VID_Init_Cvars (); S_Init_Cvars (); - SCR_Init_Cvars (); Key_Init_Cvars (); Con_Init_Cvars (); PR_Init_Cvars (); SV_Progs_Init_Cvars (); - Draw_Init_Cvars (); + R_Init_Cvars (); R_Particles_Init_Cvars (); Mod_Init_Cvars (); diff --git a/nq/source/r_cvar.c b/nq/source/r_cvar.c new file mode 100644 index 000000000..300cd7344 --- /dev/null +++ b/nq/source/r_cvar.c @@ -0,0 +1,186 @@ +#include "QF/cvar.h" + +extern cvar_t *gl_sky_divide; // FIXME +extern void R_ForceLightUpdate (void); + +cvar_t *cl_crossx; +cvar_t *cl_crossy; +cvar_t *cl_verstring; +cvar_t *crosshair; +cvar_t *crosshaircolor; + +cvar_t *d_mipcap; +cvar_t *d_mipscale; +cvar_t *d_subdiv16; + +cvar_t *gl_affinemodels; +cvar_t *gl_clear; +cvar_t *gl_colorlights; +cvar_t *gl_conalpha; +cvar_t *gl_conspin; +cvar_t *gl_constretch; +cvar_t *gl_cull; +cvar_t *gl_fb_bmodels; +cvar_t *gl_fb_models; +cvar_t *gl_fires; +cvar_t *gl_flashblend; +cvar_t *gl_keeptjunctions; +cvar_t *gl_lightmap_components; +cvar_t *gl_lightmode; +cvar_t *gl_max_size; +cvar_t *gl_nocolors; +cvar_t *gl_picmip; +cvar_t *gl_playermip; +cvar_t *gl_polyblend; +cvar_t *gl_reporttjunctions; +cvar_t *gl_skymultipass; +cvar_t *gl_smoothmodels; +cvar_t *gl_texsort; +cvar_t *gl_triplebuffer; + +cvar_t *r_aliasstats; +cvar_t *r_aliastransadj; +cvar_t *r_aliastransbase; +cvar_t *r_ambient; +cvar_t *r_clearcolor; +cvar_t *r_drawentities; +cvar_t *r_drawflat; +cvar_t *r_draworder; +cvar_t *r_drawviewmodel; +cvar_t *r_dspeeds; +cvar_t *r_dynamic; +cvar_t *r_fullbright; +cvar_t *r_graphheight; +cvar_t *r_lightmap; +cvar_t *r_maxedges; +cvar_t *r_maxsurfs; +cvar_t *r_mirroralpha; +cvar_t *r_netgraph; +cvar_t *r_norefresh; +cvar_t *r_novis; +cvar_t *r_numedges; +cvar_t *r_numsurfs; +cvar_t *r_particles; +cvar_t *r_reportedgeout; +cvar_t *r_reportsurfout; +cvar_t *r_shadows; +cvar_t *r_skyname; +cvar_t *r_speeds; +cvar_t *r_timegraph; +cvar_t *r_wateralpha; +cvar_t *r_waterripple; +cvar_t *r_waterwarp; + +cvar_t *scr_centertime; +cvar_t *scr_consize; +cvar_t *scr_conspeed; +cvar_t *scr_fov; +cvar_t *scr_printspeed; +cvar_t *scr_showpause; +cvar_t *scr_showram; +cvar_t *scr_showturtle; +cvar_t *scr_viewsize; + +unsigned char lighthalf_v[3]; +qboolean lighthalf; + +void +gl_lightmode_callback (cvar_t *cvar) +{ + if (cvar->int_val) { + lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 128; + lighthalf = 1; + } else { + lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 255; + lighthalf = 0; + } + + R_ForceLightUpdate (); +} + +void +R_Init_Cvars (void) +{ + + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis"); + cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis."); + cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis"); + cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); + cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, "Client version string"); + crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old without color, 2 new with colors"); + crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old, 2 new with color"); + crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Color of the new crosshair"); + crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Crosshair 2's color"); + + d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, "None"); + d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, "None"); + d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, "None"); + + gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_NONE, NULL, "None"); + gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, "None"); + gl_colorlights = Cvar_Get ("gl_colorlights", "1", CVAR_ROM, NULL, "Whether to use RGB lightmaps or not"); + gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, "alpha value for the console background"); + gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, "speed at which the console spins"); + gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, "whether slide the console or stretch it"); + gl_cull = Cvar_Get ("gl_cull", "1", CVAR_NONE, NULL, "None"); + gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for bmodels"); + gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for models.. " "This is very handy, but costs me 2 FPS.. (=:]"); + gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, "Toggles lavaball and rocket fireballs"); + gl_flashblend = Cvar_Get ("gl_flashblend", "0", CVAR_NONE, NULL, "None"); + gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_NONE, NULL, "None"); + gl_lightmap_components = Cvar_Get ("gl_lightmap_components", "4", CVAR_ROM, NULL, "Lightmap texture components. 1 is greyscale, 3 is RGB, 4 is RGBA."); + gl_lightmode = Cvar_Get ("gl_lightmode", "1", CVAR_ARCHIVE, gl_lightmode_callback, "Lighting mode (0 = GLQuake style, 1 = new style)"); + gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "Texture dimension"); + gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, "None"); + gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, NULL, "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); + gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, "None"); + gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_NONE, NULL, "None"); + gl_reporttjunctions = Cvar_Get ("gl_reporttjunctions", "0", CVAR_NONE, NULL, "None"); + gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_NONE, NULL, "controls wether the skydome is single or double pass"); + gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_NONE, NULL, "None"); + gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_NONE, NULL, "None"); + gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, "Set to 1 by default. Fixes status bar flicker on some hardware"); + + r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, "None"); + r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, "None"); + r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, "None"); + r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, "None"); + r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, "None"); + r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "None"); + r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, "None"); + r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "None"); + r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, NULL, "None"); + r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, "None"); + r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, "None"); + r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, NULL, "None"); + r_graphheight = Cvar_Get ("r_graphheight", "10", CVAR_NONE, NULL, "None"); + r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_NONE, NULL, "None"); + r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, "None"); + r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, "None"); + r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_NONE, NULL, "None"); + r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, "None"); + r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, "None"); + r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, "None"); + r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, "None"); + r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, "None"); + r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, "whether or not to draw particles"); + r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, "None"); + r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, "None"); + r_shadows = Cvar_Get ("r_shadows", "0", CVAR_NONE, NULL, "None"); + r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, "name of the current skybox"); + r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "None"); + r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, "None"); + r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, "None"); + r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, "None"); + r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, "None"); + + scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds the screen hints are displayed on the screen"); + scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); + scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly in the console screen scrolls up and down"); + scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "field of view. 90 is normal, smaller numbers zoom"); + scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); + scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Toggles display of pause graphic"); + scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show ram icon when low on ram in game"); + scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show turtle icon when fps is lower than 10"); + scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); +} diff --git a/nq/source/screen.c b/nq/source/screen.c index 1aa69b07b..b405d1404 100644 --- a/nq/source/screen.c +++ b/nq/source/screen.c @@ -52,6 +52,7 @@ #include "client.h" #include "d_iface.h" #include "host.h" +#include "r_cvar.h" #include "sbar.h" #include "view.h" @@ -111,19 +112,6 @@ float scr_conlines; // lines of console to display int oldscreensize, oldfov; int oldsbar; -cvar_t *scr_viewsize; -cvar_t *scr_fov; // 10 - 170 -cvar_t *scr_conspeed; -cvar_t *scr_consize; -cvar_t *scr_centertime; -cvar_t *scr_showram; -cvar_t *scr_showturtle; -cvar_t *scr_showpause; -cvar_t *scr_printspeed; -cvar_t *crosshair; -cvar_t *crosshaircolor; -cvar_t *cl_crossx; -cvar_t *cl_crossy; qboolean scr_initialized; // ready to draw @@ -402,26 +390,6 @@ SCR_SizeDown_f (void) //============================================================================ -void -SCR_Init_Cvars (void) -{ - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "field of view. 90 is normal, smaller numbers zoom"); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly in the console screen scrolls up and down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show ram icon when low on ram in game"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show turtle icon when fps is lower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Show paused graphic when paused"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds the screen hints are displayed on the screen"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); - - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Crosshair 2's color"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old, 2 new with color"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis"); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis"); -} - - void SCR_Init (void) { diff --git a/nq/source/sw_rmain.c b/nq/source/sw_rmain.c index 7c3cea276..e8d341855 100644 --- a/nq/source/sw_rmain.c +++ b/nq/source/sw_rmain.c @@ -37,6 +37,7 @@ #include "chase.h" #include "client.h" +#include "r_cvar.h" #include "r_local.h" #include "view.h" @@ -138,29 +139,6 @@ float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2; void R_MarkLeaves (void); -cvar_t *r_particles; -cvar_t *r_draworder; -cvar_t *r_speeds; -cvar_t *r_timegraph; -cvar_t *r_graphheight; -cvar_t *r_clearcolor; -cvar_t *r_waterwarp; -cvar_t *r_fullbright; -cvar_t *r_drawentities; -cvar_t *r_drawviewmodel; -cvar_t *r_aliasstats; -cvar_t *r_dspeeds; -cvar_t *r_drawflat; -cvar_t *r_ambient; -cvar_t *r_reportsurfout; -cvar_t *r_maxsurfs; -cvar_t *r_numsurfs; -cvar_t *r_reportedgeout; -cvar_t *r_maxedges; -cvar_t *r_numedges; -cvar_t *r_aliastransbase; -cvar_t *r_aliastransadj; - void CreatePassages (void); void SetVisibilityByPassages (void); @@ -217,35 +195,6 @@ R_Init (void) Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "No Description"); Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "No Description"); - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, - "whether or not to draw particles"); - - r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "None"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "None"); - r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, "None"); - r_graphheight = Cvar_Get ("r_graphheight", "10", CVAR_NONE, NULL, "None"); - r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, "None"); - r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, "None"); - r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, "None"); - r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, "None"); - r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_NONE, NULL, "None"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "None"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_NONE, NULL, - "None"); - r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, "None"); - r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, "None"); - r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, - "None"); - r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, "None"); - r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, "None"); - r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, - "None"); - r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, "None"); - r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, "None"); - r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, - "None"); - r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, - "None"); Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES); Cvar_SetValue (r_maxsurfs, (float) NUMSTACKSURFACES); diff --git a/nq/source/sw_rpart.c b/nq/source/sw_rpart.c index de7162bd8..7461b0b92 100644 --- a/nq/source/sw_rpart.c +++ b/nq/source/sw_rpart.c @@ -39,6 +39,7 @@ #include "client.h" #include "host.h" +#include "r_cvar.h" #include "r_local.h" int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 }; @@ -51,7 +52,6 @@ particle_t *particles; int r_numparticles; vec3_t r_pright, r_pup, r_ppn; -cvar_t *r_particles; /* R_MaxParticlesCheck diff --git a/nq/source/sw_rsurf.c b/nq/source/sw_rsurf.c index c42b95988..44c517be0 100644 --- a/nq/source/sw_rsurf.c +++ b/nq/source/sw_rsurf.c @@ -657,3 +657,8 @@ R_GenTile (msurface_t *psurf, void *pdest) Sys_Error ("Unknown tile type"); } } + +void +R_ForceLightUpdate (void) +{ +} diff --git a/qw/include/r_cvar.h b/qw/include/r_cvar.h new file mode 100644 index 000000000..9b669116e --- /dev/null +++ b/qw/include/r_cvar.h @@ -0,0 +1,75 @@ +extern cvar_t *cl_crossx; +extern cvar_t *cl_crossy; +extern cvar_t *cl_verstring; +extern cvar_t *crosshair; +extern cvar_t *crosshaircolor; + +extern cvar_t *d_mipcap; +extern cvar_t *d_mipscale; +extern cvar_t *d_subdiv16; + +extern cvar_t *gl_affinemodels; +extern cvar_t *gl_clear; +extern cvar_t *gl_conalpha; +extern cvar_t *gl_conspin; +extern cvar_t *gl_constretch; +extern cvar_t *gl_dlight_lightmap; +extern cvar_t *gl_dlight_polyblend; +extern cvar_t *gl_dlight_smooth; +extern cvar_t *gl_fb_bmodels; +extern cvar_t *gl_fb_models; +extern cvar_t *gl_fires; +extern cvar_t *gl_keeptjunctions; +extern cvar_t *gl_lerp_anim; +extern cvar_t *gl_lightmap_components; +extern cvar_t *gl_lightmode; +extern cvar_t *gl_max_size; +extern cvar_t *gl_nocolors; +extern cvar_t *gl_picmip; +extern cvar_t *gl_playermip; +extern cvar_t *gl_sky_clip; +extern cvar_t *gl_skymultipass; +extern cvar_t *gl_triplebuffer; + +extern cvar_t *r_aliasstats; +extern cvar_t *r_aliastransadj; +extern cvar_t *r_aliastransbase; +extern cvar_t *r_ambient; +extern cvar_t *r_clearcolor; +extern cvar_t *r_drawentities; +extern cvar_t *r_drawflat; +extern cvar_t *r_draworder; +extern cvar_t *r_drawviewmodel; +extern cvar_t *r_dspeeds; +extern cvar_t *r_dynamic; +extern cvar_t *r_graphheight; +extern cvar_t *r_maxedges; +extern cvar_t *r_maxsurfs; +extern cvar_t *r_netgraph; +extern cvar_t *r_netgraph_alpha; +extern cvar_t *r_netgraph_box; +extern cvar_t *r_norefresh; +extern cvar_t *r_novis; +extern cvar_t *r_numedges; +extern cvar_t *r_numsurfs; +extern cvar_t *r_particles; +extern cvar_t *r_reportedgeout; +extern cvar_t *r_reportsurfout; +extern cvar_t *r_shadows; +extern cvar_t *r_skyname; +extern cvar_t *r_speeds; +extern cvar_t *r_timegraph; +extern cvar_t *r_wateralpha; +extern cvar_t *r_waterripple; +extern cvar_t *r_waterwarp; +extern cvar_t *r_zgraph; + +extern cvar_t *scr_centertime; +extern cvar_t *scr_consize; +extern cvar_t *scr_conspeed; +extern cvar_t *scr_fov; +extern cvar_t *scr_printspeed; +extern cvar_t *scr_showpause; +extern cvar_t *scr_showram; +extern cvar_t *scr_showturtle; +extern cvar_t *scr_viewsize; diff --git a/qw/source/Makefile.am b/qw/source/Makefile.am index 679b10b0a..cfb9325f1 100644 --- a/qw/source/Makefile.am +++ b/qw/source/Makefile.am @@ -96,7 +96,7 @@ client_POST_LIBS= $(top_builddir)/libs/video/targets/libQFjs.la client_SOURCES= cl_cam.c cl_cmd.c cl_cvar.c cl_demo.c cl_ents.c cl_input.c \ cl_main.c cl_misc.c cl_parse.c cl_pred.c cl_slist.c cl_tent.c \ console.c keys.c locs.c nonintel.c \ - pcx.c r_efrag.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c cl_math.S $(syscl_SRC) + pcx.c r_cvar.c r_efrag.c r_view.c sbar.c skin.c teamplay.c tga.c wad.c cl_math.S $(syscl_SRC) # Software-rendering clients # diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index 986ec38e1..fb085683b 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1605,7 +1605,6 @@ Host_Init (void) CL_Prediction_Init_Cvars (); COM_Init_Cvars (); Con_Init_Cvars (); - Draw_Init_Cvars (); COM_Filesystem_Init_Cvars (); Game_Init_Cvars (); IN_Init_Cvars (); @@ -1615,7 +1614,6 @@ Host_Init (void) Pmove_Init_Cvars (); R_Init_Cvars (); S_Init_Cvars (); - SCR_Init_Cvars (); Team_Init_Cvars (); V_Init_Cvars (); VID_Init_Cvars (); diff --git a/qw/source/d_init.c b/qw/source/d_init.c index bcbc87eb8..91b3f1f6f 100644 --- a/qw/source/d_init.c +++ b/qw/source/d_init.c @@ -36,14 +36,11 @@ #include "bothdefs.h" #include "d_local.h" +#include "r_cvar.h" #include "render.h" #define NUM_MIPS 4 -cvar_t *d_subdiv16; -cvar_t *d_mipcap; -cvar_t *d_mipscale; - surfcache_t *d_initial_rover; qboolean d_roverwrapped; int d_minmip; @@ -77,17 +74,6 @@ D_Init (void) VID_InitBuffers (); } -void -D_Init_Cvars (void) -{ - d_subdiv16 = Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, - "Set to enable extreme perspective correction"); - d_mipcap = Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, - "Detail level. 0 is highest, 3 is lowest."); - d_mipscale = Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, - "Detail level of objects. 0 is highest, 3 is lowest."); -} - /* D_CopyRects */ diff --git a/qw/source/draw.c b/qw/source/draw.c index ad441b93c..0534375bc 100644 --- a/qw/source/draw.c +++ b/qw/source/draw.c @@ -202,12 +202,6 @@ Draw_Init (void) } -void -Draw_Init_Cvars (void) -{ -} - - /* Draw_Character8 diff --git a/qw/source/gl_draw.c b/qw/source/gl_draw.c index 8764c7a48..9ab2d904b 100644 --- a/qw/source/gl_draw.c +++ b/qw/source/gl_draw.c @@ -48,21 +48,13 @@ #include "client.h" #include "glquake.h" +#include "r_cvar.h" #include "sbar.h" extern byte *vid_basepal; extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor, *gl_lightmap_components; -cvar_t *gl_max_size; -cvar_t *gl_picmip; - -cvar_t *gl_constretch; -cvar_t *gl_conalpha; -cvar_t *gl_conspin; -cvar_t *cl_verstring; -cvar_t *gl_lightmode; // LordHavoc: lighting mode - byte *draw_chars; // 8*8 graphic characters qpic_t *draw_disc; qpic_t *draw_backtile; @@ -251,21 +243,6 @@ Draw_TextBox (int x, int y, int width, int lines) extern void glrmain_init (void); extern void glrsurf_init (void); extern void GL_TextureMode_f (void); -extern void R_ForceLightUpdate (void); - -void -gl_lightmode_callback (cvar_t *cvar) -{ - if (cvar->int_val) { - lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 128; - lighthalf = 1; - } else { - lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 255; - lighthalf = 0; - } - - R_ForceLightUpdate (); -} void @@ -284,8 +261,6 @@ Draw_Init (void) Cvar_Set (gl_lightmode, "0"); } - gl_lightmode_callback(gl_lightmode); - Cmd_AddCommand ("gl_texturemode", &GL_TextureMode_f, "Texture mipmap quality."); // load the console background and the charset @@ -316,28 +291,6 @@ Draw_Init (void) glrsurf_init (); } - -void -Draw_Init_Cvars (void) -{ - gl_lightmode = Cvar_Get ("gl_lightmode", "1", CVAR_ARCHIVE, - gl_lightmode_callback, - "Lighting mode (0 = GLQuake style, 1 = new style)"); - gl_max_size = Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "Texture dimension"); - gl_picmip = Cvar_Get ("gl_picmip", "0", CVAR_NONE, NULL, "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); - gl_constretch = Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, - "whether slide the console or stretch it"); - gl_conalpha = Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, - "alpha value for the console background"); - gl_conspin = Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, - "speed at which the console spins"); - gl_lightmap_components = Cvar_Get ("gl_lightmap_components", "4", CVAR_ROM, - NULL, "Lightmap texture components. 1 is greyscale, 3 is RGB, 4 is RGBA."); - cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, - NULL, "Client version string"); -} - - /* Draw_Character8 diff --git a/qw/source/gl_rmain.c b/qw/source/gl_rmain.c index e5efa3890..9cbad6144 100644 --- a/qw/source/gl_rmain.c +++ b/qw/source/gl_rmain.c @@ -55,6 +55,7 @@ #include "cl_main.h" #include "cl_parse.h" //FIXME CL_NewTranslation #include "glquake.h" +#include "r_cvar.h" #include "r_dynamic.h" #include "r_local.h" #include "view.h" @@ -101,34 +102,6 @@ float modelalpha; // Ender (EXtend) Alpha void R_MarkLeaves (void); -cvar_t *r_drawentities; -cvar_t *r_drawviewmodel; -cvar_t *r_dynamic; -cvar_t *r_netgraph; -cvar_t *r_norefresh; -cvar_t *r_novis; -cvar_t *r_particles; -cvar_t *r_speeds; -cvar_t *r_shadows; -cvar_t *r_wateralpha; -cvar_t *r_waterripple; - -cvar_t *gl_affinemodels; -cvar_t *gl_clear; -cvar_t *gl_dlight_lightmap; -cvar_t *gl_dlight_polyblend; -cvar_t *gl_fb_models; -cvar_t *gl_fb_bmodels; -cvar_t *gl_keeptjunctions; -cvar_t *gl_lerp_anim; -cvar_t *gl_nocolors; -cvar_t *gl_playermip; -cvar_t *gl_dlight_smooth; - -cvar_t *r_skyname; -cvar_t *gl_skymultipass; -cvar_t *gl_sky_clip; - extern cvar_t *scr_fov; extern byte gammatable[256]; diff --git a/qw/source/gl_rmisc.c b/qw/source/gl_rmisc.c index 05b716587..98852ae59 100644 --- a/qw/source/gl_rmisc.c +++ b/qw/source/gl_rmisc.c @@ -57,11 +57,6 @@ varray_t2f_c4f_v3f_t varray[MAX_VARRAY_VERTS]; qboolean VID_Is8bit (void); void R_InitBubble (void); -cvar_t *gl_fires; - -cvar_t *r_netgraph_alpha; -cvar_t *r_netgraph_box; - extern cvar_t *gl_lerp_anim; extern cvar_t *r_netgraph; @@ -219,42 +214,6 @@ R_Init (void) glVertexPointer (3, GL_FLOAT, sizeof(varray[0]), varray[0].vertex); } -void -R_Init_Cvars (void) -{ - r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, "Set to 1 to disable display refresh"); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "Toggles drawing of entities (almost everything but the world)"); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, "Toggles drawing of view models (your weapons)"); - r_shadows = Cvar_Get ("r_shadows", "0", CVAR_ARCHIVE, NULL, "Set to 1 to enable shadows for entities"); - r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, "Determine opacity of liquids. 1 = solid, 0 = transparent, otherwise translucent."); - /* FIXME what does r_waterripple use for units? */ - r_waterripple = Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, "Set to make liquids ripple, a good setting is 5"); - r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, "Set to 0 to disable lightmap changes"); - r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, "Set to 1 to enable runtime visibility checking (SLOW)"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "Display drawing time and statistics of what is being viewed"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_ARCHIVE, NULL, "Graph network stats"); - r_netgraph_alpha = Cvar_Get ("r_netgraph_alpha", "0.5", CVAR_ARCHIVE, NULL, "Net graph translucency"); - r_netgraph_box = Cvar_Get ("r_netgraph_box", "1", CVAR_ARCHIVE, NULL, "Draw box around net graph"); - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, "whether or not to draw particles"); - r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, "name of the current skybox"); - - gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ARCHIVE, NULL, "Makes texture rendering quality better if set to 1"); - gl_clear = Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, "Set to 1 to make background black. Useful for removing HOM effect"); - gl_dlight_lightmap = Cvar_Get ("gl_dlight_lightmap", "1", CVAR_ARCHIVE, NULL, "Set to 1 for high quality dynamic lighting."); - gl_dlight_polyblend = Cvar_Get ("gl_dlight_polyblend", "0", CVAR_ARCHIVE, NULL, "Set to 1 to use a dynamic light effect faster on GL"); - gl_dlight_smooth = Cvar_Get ("gl_dlight_smooth", "1", CVAR_ARCHIVE, NULL, "Smooth dynamic vertex lighting"); - gl_fb_bmodels = Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for bmodels"); - gl_fb_models = Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, "Toggles fullbright color support for models"); - gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, "Toggles lavaball and rocket fireballs"); - gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_ARCHIVE, NULL, "Set to 0 to turn off colinear vertexes upon level load"); - gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL, "Toggles model animation interpolation"); - gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, "Set to 1, turns off all player colors"); - gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, "Detail of player skins. 0 best, 4 worst."); - gl_sky_clip = Cvar_Get ("gl_sky_clip", "0", CVAR_ARCHIVE, NULL, "controls whether sky is drawn first (0) or later (1)"); - gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, "subdivide sky polys"); - gl_skymultipass = Cvar_Get ("gl_skymultipass", "1", CVAR_ARCHIVE, NULL, "controls whether the skydome is single or double pass"); -} - /* R_NewMap */ diff --git a/qw/source/gl_rsurf.c b/qw/source/gl_rsurf.c index 5c734b880..a26b288e2 100644 --- a/qw/source/gl_rsurf.c +++ b/qw/source/gl_rsurf.c @@ -45,15 +45,12 @@ #include "client.h" #include "glquake.h" +#include "r_cvar.h" #include "r_local.h" #include "r_shared.h" qboolean r_cache_thrash; -// extern cvar_t *gl_lightmap_align; -cvar_t *gl_lightmap_components; -// extern cvar_t *gl_texsubimage; - extern double realtime; int skytexturenum; diff --git a/qw/source/gl_screen.c b/qw/source/gl_screen.c index a7d0cf6ba..cca0ada99 100644 --- a/qw/source/gl_screen.c +++ b/qw/source/gl_screen.c @@ -52,6 +52,7 @@ #include "client.h" #include "glquake.h" #include "host.h" +#include "r_cvar.h" #include "r_local.h" #include "sbar.h" #include "view.h" @@ -116,20 +117,6 @@ float scr_conlines; // lines of console to display int oldscreensize, oldfov; int oldsbar; -cvar_t *scr_viewsize; -cvar_t *scr_fov; // 10 - 170 -cvar_t *scr_conspeed; -cvar_t *scr_consize; -cvar_t *scr_centertime; -cvar_t *scr_showram; -cvar_t *scr_showturtle; -cvar_t *scr_showpause; -cvar_t *scr_printspeed; -cvar_t *gl_triplebuffer; -cvar_t *crosshair; -cvar_t *crosshaircolor; -cvar_t *cl_crossx; -cvar_t *cl_crossy; qboolean scr_initialized; // ready to draw @@ -388,27 +375,6 @@ SCR_SizeDown_f (void) //============================================================================ -void -SCR_Init_Cvars (void) -{ - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "Your point of view in degrees. Smaller than 90 zooms in."); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly console scrolls up or down"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show RAM icon if game is running low on memory"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show a turtle icon if your fps is slower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Toggles display of pause graphic"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds screen hints are displayed"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); - gl_triplebuffer = Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, "Set to 1 by default. Fixes status bar flicker on some hardware"); - - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Color of the new crosshair"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old without color, 2 new with colors"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis."); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); -} - - void SCR_Init (void) { diff --git a/qw/source/r_cvar.c b/qw/source/r_cvar.c new file mode 100644 index 000000000..9388b965c --- /dev/null +++ b/qw/source/r_cvar.c @@ -0,0 +1,341 @@ +#include "QF/cvar.h" + +extern cvar_t *gl_sky_divide; // FIXME +extern void R_ForceLightUpdate (void); + +cvar_t *cl_crossx; +cvar_t *cl_crossy; +cvar_t *cl_verstring; +cvar_t *crosshair; +cvar_t *crosshaircolor; + +cvar_t *d_mipcap; +cvar_t *d_mipscale; +cvar_t *d_subdiv16; + +cvar_t *gl_affinemodels; +cvar_t *gl_clear; +cvar_t *gl_conalpha; +cvar_t *gl_conspin; +cvar_t *gl_constretch; +cvar_t *gl_dlight_lightmap; +cvar_t *gl_dlight_lightmap; +cvar_t *gl_dlight_polyblend; +cvar_t *gl_dlight_polyblend; +cvar_t *gl_dlight_smooth; +cvar_t *gl_fb_bmodels; +cvar_t *gl_fb_models; +cvar_t *gl_fires; +cvar_t *gl_keeptjunctions; +cvar_t *gl_lerp_anim; +cvar_t *gl_lightmap_components; +cvar_t *gl_lightmode; +cvar_t *gl_max_size; +cvar_t *gl_nocolors; +cvar_t *gl_picmip; +cvar_t *gl_playermip; +cvar_t *gl_sky_clip; +cvar_t *gl_skymultipass; +cvar_t *gl_triplebuffer; + +cvar_t *r_aliasstats; +cvar_t *r_aliastransadj; +cvar_t *r_aliastransbase; +cvar_t *r_ambient; +cvar_t *r_clearcolor; +cvar_t *r_drawentities; +cvar_t *r_drawentities; +cvar_t *r_drawflat; +cvar_t *r_draworder; +cvar_t *r_drawviewmodel; +cvar_t *r_drawviewmodel; +cvar_t *r_dspeeds; +cvar_t *r_dynamic; +cvar_t *r_graphheight; +cvar_t *r_maxedges; +cvar_t *r_maxsurfs; +cvar_t *r_netgraph; +cvar_t *r_netgraph; +cvar_t *r_netgraph_alpha; +cvar_t *r_netgraph_box; +cvar_t *r_norefresh; +cvar_t *r_novis; +cvar_t *r_numedges; +cvar_t *r_numsurfs; +cvar_t *r_particles; +cvar_t *r_particles; +cvar_t *r_reportedgeout; +cvar_t *r_reportsurfout; +cvar_t *r_shadows; +cvar_t *r_skyname; +cvar_t *r_speeds; +cvar_t *r_speeds; +cvar_t *r_timegraph; +cvar_t *r_wateralpha; +cvar_t *r_waterripple; +cvar_t *r_waterwarp; +cvar_t *r_zgraph; + +cvar_t *scr_centertime; +cvar_t *scr_consize; +cvar_t *scr_conspeed; +cvar_t *scr_fov; +cvar_t *scr_printspeed; +cvar_t *scr_showpause; +cvar_t *scr_showram; +cvar_t *scr_showturtle; +cvar_t *scr_viewsize; + +unsigned char lighthalf_v[3]; +qboolean lighthalf; + +void +gl_lightmode_callback (cvar_t *cvar) +{ + if (cvar->int_val) { + lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 128; + lighthalf = 1; + } else { + lighthalf_v[0] = lighthalf_v[1] = lighthalf_v[2] = 255; + lighthalf = 0; + } + + R_ForceLightUpdate (); +} + +void +R_Init_Cvars (void) +{ + cl_crossx = + Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, + "Sets the position of the crosshair on the X-axis."); + cl_crossy = + Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, + "Sets the position of the crosshair on the Y-axis."); + cl_verstring = + Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE, NULL, + "Client version string"); + crosshair = + Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, + "Crosshair type. 0 off, 1 old without color, 2 new with colors"); + crosshaircolor = + Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, + "Color of the new crosshair"); + + d_mipcap = + Cvar_Get ("d_mipcap", "0", CVAR_NONE, NULL, + "Detail level. 0 is highest, 3 is lowest."); + d_mipscale = + Cvar_Get ("d_mipscale", "1", CVAR_NONE, NULL, + "Detail level of objects. 0 is highest, 3 is lowest."); + d_subdiv16 = + Cvar_Get ("d_subdiv16", "1", CVAR_NONE, NULL, + "Set to enable extreme perspective correction"); + + gl_affinemodels = + Cvar_Get ("gl_affinemodels", "0", CVAR_ARCHIVE, NULL, + "Makes texture rendering quality better if set to 1"); + gl_clear = + Cvar_Get ("gl_clear", "0", CVAR_NONE, NULL, + "Set to 1 to make background black. Useful for removing HOM effect"); + gl_conalpha = + Cvar_Get ("gl_conalpha", "0.6", CVAR_ARCHIVE, NULL, + "alpha value for the console background"); + gl_conspin = + Cvar_Get ("gl_conspin", "0", CVAR_ARCHIVE, NULL, + "speed at which the console spins"); + gl_constretch = + Cvar_Get ("gl_constretch", "0", CVAR_ARCHIVE, NULL, + "whether slide the console or stretch it"); + gl_dlight_lightmap = + Cvar_Get ("gl_dlight_lightmap", "1", CVAR_ARCHIVE, NULL, + "Set to 1 for high quality dynamic lighting."); + gl_dlight_polyblend = + Cvar_Get ("gl_dlight_polyblend", "0", CVAR_ARCHIVE, NULL, + "Set to 1 to use a dynamic light effect faster on GL"); + gl_dlight_smooth = + Cvar_Get ("gl_dlight_smooth", "1", CVAR_ARCHIVE, NULL, + "Smooth dynamic vertex lighting"); + gl_fb_bmodels = + Cvar_Get ("gl_fb_bmodels", "1", CVAR_ARCHIVE, NULL, + "Toggles fullbright color support for bmodels"); + gl_fb_models = + Cvar_Get ("gl_fb_models", "1", CVAR_ARCHIVE, NULL, + "Toggles fullbright color support for models"); + gl_fires = + Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL, + "Toggles lavaball and rocket fireballs"); + gl_keeptjunctions = + Cvar_Get ("gl_keeptjunctions", "1", CVAR_ARCHIVE, NULL, + "Set to 0 to turn off colinear vertexes upon level load"); + gl_lerp_anim = + Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL, + "Toggles model animation interpolation"); + gl_lightmap_components = + Cvar_Get ("gl_lightmap_components", "4", CVAR_ROM, NULL, + "Lightmap texture components. 1 is greyscale, 3 is RGB, 4 is RGBA."); + gl_lightmode = + Cvar_Get ("gl_lightmode", "1", CVAR_ARCHIVE, gl_lightmode_callback, + "Lighting mode (0 = GLQuake style, 1 = new style)"); + gl_max_size = + Cvar_Get ("gl_max_size", "1024", CVAR_NONE, NULL, "Texture dimension"); + gl_nocolors = + Cvar_Get ("gl_nocolors", "0", CVAR_NONE, NULL, + "Set to 1, turns off all player colors"); + gl_picmip = + Cvar_Get ("gl_picmip", "0", CVAR_NONE, NULL, + "Dimensions of displayed textures. 0 is normal, 1 is half, 2 is 1/4"); + gl_playermip = + Cvar_Get ("gl_playermip", "0", CVAR_NONE, NULL, + "Detail of player skins. 0 best, 4 worst."); + gl_sky_clip = + Cvar_Get ("gl_sky_clip", "0", CVAR_ARCHIVE, NULL, + "controls whether sky is drawn first (0) or later (1)"); + gl_sky_divide = + Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, + "subdivide sky polys"); + gl_sky_divide = + Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, + "subdivide sky polys"); + gl_skymultipass = + Cvar_Get ("gl_skymultipass", "1", CVAR_ARCHIVE, NULL, + "controls whether the skydome is single or double pass"); + gl_triplebuffer = + Cvar_Get ("gl_triplebuffer", "1", CVAR_ARCHIVE, NULL, + "Set to 1 by default. Fixes status bar flicker on some hardware"); + + r_aliasstats = + Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, + "Toggles the displays of number of polygon models current being viewed"); + r_aliastransadj = + Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, + "Determines how much of an alias model is clipped away and how much is viewable."); + r_aliastransbase = + Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, + "Determines how much of an alias model is clipped away and how much is viewable"); + r_ambient = + Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, + "Determines the ambient lighting for a level"); + r_clearcolor = + Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, + "This sets the color for areas outside of the current map"); + r_drawentities = + Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, + "Toggles drawing of entities (almost everything but the world)"); + r_drawentities = + Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, + "Toggles the drawing of entities."); + r_drawflat = + Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, + "Toggles the drawing of textures"); + r_draworder = + Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "Toggles drawing order"); + r_drawviewmodel = + Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, + "Toggles drawing of view models (your weapons)"); + r_drawviewmodel = + Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, + "Toggles the drawing of your weapon"); + r_dspeeds = + Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, + "Toggles the display of drawing speed information"); + r_dynamic = + Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL, + "Set to 0 to disable lightmap changes"); + r_graphheight = + Cvar_Get ("r_graphheight", "32", CVAR_NONE, NULL, + "Set the number of lines displayed in the various graphs"); + r_maxedges = + Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, + "Sets the maximum number of surfaces"); + r_maxsurfs = + Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, + "Sets the maximum number of surfaces"); + r_netgraph = + Cvar_Get ("r_netgraph", "0", CVAR_ARCHIVE, NULL, "Graph network stats"); + r_netgraph = + Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, + "Toggle the display of a graph showing network performance"); + r_netgraph_alpha = + Cvar_Get ("r_netgraph_alpha", "0.5", CVAR_ARCHIVE, NULL, + "Net graph translucency"); + r_netgraph_box = + Cvar_Get ("r_netgraph_box", "1", CVAR_ARCHIVE, NULL, + "Draw box around net graph"); + r_norefresh = + Cvar_Get ("r_norefresh", "0", CVAR_NONE, NULL, + "Set to 1 to disable display refresh"); + r_novis = + Cvar_Get ("r_novis", "0", CVAR_NONE, NULL, + "Set to 1 to enable runtime visibility checking (SLOW)"); + r_numedges = + Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, + "Toggles the displaying of number of edges currently being viewed"); + r_numsurfs = + Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, + "Toggles the displaying of number of surfaces currently being viewed"); + r_particles = + Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, + "Toggles drawing of particles."); + r_particles = + Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, + "whether or not to draw particles"); + r_reportedgeout = + Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, + "Toggle the display of how many edges where not displayed"); + r_reportsurfout = + Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, + "Toggle the display of how many surfaces where not displayed"); + r_shadows = + Cvar_Get ("r_shadows", "0", CVAR_ARCHIVE, NULL, + "Set to 1 to enable shadows for entities"); + r_skyname = + Cvar_Get ("r_skyname", "none", CVAR_NONE, NULL, + "name of the current skybox"); + r_speeds = + Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, + "Display drawing time and statistics of what is being viewed"); + r_timegraph = + Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, + "Toggle the display of a performance graph"); + r_wateralpha = + Cvar_Get ("r_wateralpha", "1", CVAR_NONE, NULL, + "Determine opacity of liquids. 1 = solid, 0 = transparent, otherwise translucent."); + r_waterripple = + Cvar_Get ("r_waterripple", "0", CVAR_NONE, NULL, + "Set to make liquids ripple, a good setting is 5"); + r_waterwarp = + Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, + "Toggles whether surfaces are warped in a liquid."); + r_zgraph = + Cvar_Get ("r_zgraph", "0", CVAR_NONE, NULL, + "Toggle the graph that reports the changes of z-axis position"); + + scr_centertime = + Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, + "How long in seconds screen hints are displayed"); + scr_consize = + Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, + "fraction of the screen the console covers when down"); + scr_conspeed = + Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, + "How quickly console scrolls up or down"); + scr_fov = + Cvar_Get ("fov", "90", CVAR_NONE, NULL, + "Your point of view in degrees. Smaller than 90 zooms in."); + scr_printspeed = + Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, + "How fast the text is displayed at the end of the single player episodes"); + scr_showpause = + Cvar_Get ("showpause", "1", CVAR_NONE, NULL, + "Toggles display of pause graphic"); + scr_showram = + Cvar_Get ("showram", "1", CVAR_NONE, NULL, + "Show RAM icon if game is running low on memory"); + scr_showturtle = + Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, + "Show a turtle icon if your fps is slower than 10"); + scr_viewsize = + Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, + "Set the screen size 30 minimum, 120 maximum"); +} diff --git a/qw/source/screen.c b/qw/source/screen.c index 08506b8a3..0afe09d6b 100644 --- a/qw/source/screen.c +++ b/qw/source/screen.c @@ -52,6 +52,7 @@ #include "client.h" #include "d_iface.h" #include "host.h" +#include "r_cvar.h" #include "sbar.h" #include "view.h" @@ -111,19 +112,6 @@ float scr_conlines; // lines of console to display int oldscreensize, oldfov; int oldsbar; -cvar_t *scr_viewsize; -cvar_t *scr_fov; // 10 - 170 -cvar_t *scr_conspeed; -cvar_t *scr_consize; -cvar_t *scr_centertime; -cvar_t *scr_showram; -cvar_t *scr_showturtle; -cvar_t *scr_showpause; -cvar_t *scr_printspeed; -cvar_t *crosshair; -cvar_t *crosshaircolor; -cvar_t *cl_crossx; -cvar_t *cl_crossy; qboolean scr_initialized; // ready to draw @@ -402,26 +390,6 @@ SCR_SizeDown_f (void) //============================================================================ -void -SCR_Init_Cvars (void) -{ - scr_fov = Cvar_Get ("fov", "90", CVAR_NONE, NULL, "field of view. 90 is normal, smaller numbers zoom"); - scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE, NULL, "Set the screen size 30 minimum, 120 maximum"); - scr_consize = Cvar_Get ("scr_consize", "0.5", CVAR_ARCHIVE, NULL, "fraction of the screen the console covers when down"); - scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_NONE, NULL, "How quickly in the console screen scrolls up and down"); - scr_showram = Cvar_Get ("showram", "1", CVAR_NONE, NULL, "Show ram icon when low on ram in game"); - scr_showturtle = Cvar_Get ("showturtle", "0", CVAR_NONE, NULL, "Show turtle icon when fps is lower than 10"); - scr_showpause = Cvar_Get ("showpause", "1", CVAR_NONE, NULL, "Show paused graphic when paused"); - scr_centertime = Cvar_Get ("scr_centertime", "2", CVAR_NONE, NULL, "How long in seconds the screen hints are displayed on the screen"); - scr_printspeed = Cvar_Get ("scr_printspeed", "8", CVAR_NONE, NULL, "How fast the text is displayed at the end of the single player episodes"); - - crosshaircolor = Cvar_Get ("crosshaircolor", "79", CVAR_ARCHIVE, NULL, "Crosshair 2's color"); - crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair type. 0 off, 1 old, 2 new with color"); - cl_crossx = Cvar_Get ("cl_crossx", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the X-axis"); - cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis"); -} - - void SCR_Init (void) { diff --git a/qw/source/sw_rmain.c b/qw/source/sw_rmain.c index f2cbbdc00..82ae35cf7 100644 --- a/qw/source/sw_rmain.c +++ b/qw/source/sw_rmain.c @@ -49,6 +49,7 @@ #include "bothdefs.h" #include "cl_cam.h" #include "cl_main.h" +#include "r_cvar.h" #include "r_dynamic.h" #include "r_local.h" #include "view.h" @@ -146,35 +147,6 @@ float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2; void R_MarkLeaves (void); -cvar_t *r_draworder; -cvar_t *r_speeds; -cvar_t *r_timegraph; -cvar_t *r_netgraph; -cvar_t *r_zgraph; -cvar_t *r_graphheight; -cvar_t *r_clearcolor; -cvar_t *r_waterwarp; -cvar_t *r_drawentities; -cvar_t *r_drawviewmodel; -cvar_t *r_particles; -cvar_t *r_aliasstats; -cvar_t *r_dspeeds; -cvar_t *r_drawflat; -cvar_t *r_ambient; -cvar_t *r_reportsurfout; -cvar_t *r_maxsurfs; -cvar_t *r_numsurfs; -cvar_t *r_reportedgeout; -cvar_t *r_maxedges; -cvar_t *r_numedges; -cvar_t *r_aliastransbase; -cvar_t *r_aliastransadj; - -cvar_t *gl_dlight_lightmap; -cvar_t *gl_dlight_polyblend; - -extern cvar_t *gl_sky_divide; - extern cvar_t *scr_fov; void R_NetGraph (void); @@ -256,39 +228,6 @@ R_Init (void) D_Init (); } -void -R_Init_Cvars (void) -{ - D_Init_Cvars (); - - r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, NULL, "Toggles drawing order"); - r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, NULL, "Toggles the displaying of drawing time and" - "statistics of what is currently being viewed"); - r_timegraph = Cvar_Get ("r_timegraph", "0", CVAR_NONE, NULL, "Toggle the display of a performance graph"); - r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_NONE, NULL, "Toggle the display of a graph showing network performance"); - r_zgraph = Cvar_Get ("r_zgraph", "0", CVAR_NONE, NULL, "Toggle the graph that reports the changes of z-axis position"); - r_graphheight = Cvar_Get ("r_graphheight", "32", CVAR_NONE, NULL, "Set the number of lines displayed in the various graphs"); - r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, "Toggles the drawing of textures"); - r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, "Determines the ambient lighting for a level"); - r_clearcolor = Cvar_Get ("r_clearcolor", "2", CVAR_NONE, NULL, "This sets the color for areas outside of the current map"); - r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, NULL, "Toggles whether surfaces are warped in a liquid."); - r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, NULL, "Toggles the drawing of entities."); - r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, "Toggles the drawing of your weapon"); - r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, NULL, "Toggles drawing of particles."); - r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, NULL, "Toggles the displays of number of polygon models current being viewed"); - r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, "Toggles the display of drawing speed information"); - r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, NULL, "Toggle the display of how many surfaces where not displayed"); - r_maxsurfs = Cvar_Get ("r_maxsurfs", "0", CVAR_NONE, NULL, "Sets the maximum number of surfaces"); - r_numsurfs = Cvar_Get ("r_numsurfs", "0", CVAR_NONE, NULL, "Toggles the displaying of number of surfaces currently being viewed"); - r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL, "Toggle the display of how many edges where not displayed"); - r_maxedges = Cvar_Get ("r_maxedges", "0", CVAR_NONE, NULL, "Sets the maximum number of surfaces"); - r_numedges = Cvar_Get ("r_numedges", "0", CVAR_NONE, NULL, "Toggles the displaying of number of edges currently being viewed"); - r_aliastransbase = Cvar_Get ("r_aliastransbase", "200", CVAR_NONE, NULL, "Determines how much of an alias model is clipped away and how much is viewable"); - r_aliastransadj = Cvar_Get ("r_aliastransadj", "100", CVAR_NONE, NULL, "Determines how much of an alias model is clipped away and how much is viewable."); - gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, NULL, - "subdivide sky polys"); -} - /* R_NewMap */ diff --git a/qw/source/sw_rsurf.c b/qw/source/sw_rsurf.c index f9771417d..6d70976fd 100644 --- a/qw/source/sw_rsurf.c +++ b/qw/source/sw_rsurf.c @@ -617,3 +617,8 @@ R_GenTile (msurface_t *psurf, void *pdest) Sys_Error ("Unknown tile type"); } } + +void +R_ForceLightUpdate (void) +{ +}