diff --git a/include/QF/render.h b/include/QF/render.h index 9f7a0c690..c6977ff32 100644 --- a/include/QF/render.h +++ b/include/QF/render.h @@ -208,6 +208,7 @@ typedef struct { vec4f_t viewrotation; int ambientlight; + int drawflat; float fov_x, fov_y; } refdef_t; diff --git a/include/r_cvar.h b/include/r_cvar.h index c8b02f489..5b1090c1d 100644 --- a/include/r_cvar.h +++ b/include/r_cvar.h @@ -48,12 +48,10 @@ extern struct cvar_s *gl_vector_light; extern struct cvar_s *r_aliasstats; extern struct cvar_s *r_aliastransadj; extern struct cvar_s *r_aliastransbase; -extern struct cvar_s *r_ambient; extern struct cvar_s *r_clearcolor; extern struct cvar_s *r_dlight_lightmap; extern struct cvar_s *r_drawentities; extern struct cvar_s *r_drawexplosions; -extern struct cvar_s *r_drawflat; extern struct cvar_s *r_drawviewmodel; extern struct cvar_s *r_dspeeds; extern struct cvar_s *r_dynamic; diff --git a/libs/video/renderer/r_cvar.c b/libs/video/renderer/r_cvar.c index 94a9b88e8..6f5f16d64 100644 --- a/libs/video/renderer/r_cvar.c +++ b/libs/video/renderer/r_cvar.c @@ -53,13 +53,11 @@ cvar_t *d_mipscale; cvar_t *r_aliasstats; cvar_t *r_aliastransadj; cvar_t *r_aliastransbase; -cvar_t *r_ambient; cvar_t *r_clearcolor; cvar_t *r_dlight_lightmap; cvar_t *r_dlight_max; cvar_t *r_drawentities; cvar_t *r_drawexplosions; -cvar_t *r_drawflat; cvar_t *r_drawviewmodel; cvar_t *r_dspeeds; cvar_t *r_dynamic; @@ -230,8 +228,6 @@ R_Init_Cvars (void) 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"); @@ -245,8 +241,6 @@ R_Init_Cvars (void) "everything but the world)"); r_drawexplosions = Cvar_Get ("r_drawexplosions", "1", CVAR_ARCHIVE, NULL, "Draw explosions."); - r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, - "Toggles the drawing of textures"); r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL, "Toggles view model drawing (your weapons)"); r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, NULL, diff --git a/libs/video/renderer/sw/d_edge.c b/libs/video/renderer/sw/d_edge.c index 59963dc3a..930d35707 100644 --- a/libs/video/renderer/sw/d_edge.c +++ b/libs/video/renderer/sw/d_edge.c @@ -158,7 +158,7 @@ D_DrawSurfaces (void) VectorCopy (transformed_modelorg, world_transformed_modelorg); // TODO: could preset a lot of this at mode set time - if (r_drawflat->int_val) { + if (r_refdef.drawflat) { for (s = &surfaces[1]; s < surface_p; s++) { if (!s->spans) continue; diff --git a/libs/video/renderer/sw/sw_rmisc.c b/libs/video/renderer/sw/sw_rmisc.c index 1dfa026f8..075c8b1b4 100644 --- a/libs/video/renderer/sw/sw_rmisc.c +++ b/libs/video/renderer/sw/sw_rmisc.c @@ -194,10 +194,6 @@ R_SetupFrame (void) vrect_t vrect; float w, h; - // don't allow cheats in multiplayer - Cvar_SetValue (r_ambient, 0); - Cvar_SetValue (r_drawflat, 0); - if (r_numsurfs->int_val) { if ((surface_p - surfaces) > r_maxsurfsseen) r_maxsurfsseen = surface_p - surfaces; @@ -217,8 +213,6 @@ R_SetupFrame (void) r_numallocatededges, r_maxedgesseen); } - r_refdef.ambientlight = max (r_ambient->value, 0); - R_CheckVariables (); R_AnimateLight (); diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 44041949b..9c7fb5c2d 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -81,6 +81,9 @@ cvar_t *cl_nolerp; cvar_t *hud_fps; cvar_t *hud_time; +static cvar_t *r_ambient; +static cvar_t *r_drawflat; + int fps_count; client_static_t cls; @@ -182,6 +185,13 @@ CL_InitCvars (void) Cvar_MakeAlias ("show_fps", hud_fps); hud_time = Cvar_Get ("hud_time", "0", CVAR_ARCHIVE, NULL, "display the current time"); + + //FIXME not hooked up (don't do anything), but should not work in + //multi-player + r_ambient = Cvar_Get ("r_ambient", "0", CVAR_NONE, NULL, + "Determines the ambient lighting for a level"); + r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL, + "Toggles the drawing of textures"); } void