diff --git a/include/r_local.h b/include/r_local.h index e4544ca03..58d5f265f 100644 --- a/include/r_local.h +++ b/include/r_local.h @@ -55,7 +55,6 @@ typedef struct #define CSHIFT_POWERUP 3 #define NUM_CSHIFTS 4 - // viewmodel lighting ======================================================= typedef struct { @@ -97,6 +96,8 @@ extern struct cvar_s *r_reportedgeout; extern struct cvar_s *r_maxedges; extern struct cvar_s *r_numedges; +extern float cl_wateralpha; + #define XCENTERING (1.0 / 2.0) #define YCENTERING (1.0 / 2.0) diff --git a/libs/video/renderer/gl/gl_rsurf.c b/libs/video/renderer/gl/gl_rsurf.c index f1fa3d5cc..06a310be1 100644 --- a/libs/video/renderer/gl/gl_rsurf.c +++ b/libs/video/renderer/gl/gl_rsurf.c @@ -560,9 +560,9 @@ static void GL_WaterSurface (msurface_t *s) { qfglBindTexture (GL_TEXTURE_2D, s->texinfo->texture->gl_texturenum); - if (r_wateralpha->value < 1.0) { + if (cl_wateralpha < 1.0) { qfglDepthMask (GL_FALSE); - color_white[3] = r_wateralpha->value * 255; + color_white[3] = cl_wateralpha * 255; qfglColor4ubv (color_white); EmitWaterPolys (s); qfglColor3ubv (color_white); @@ -583,9 +583,9 @@ R_DrawWaterSurfaces (void) // go back to the world matrix qfglLoadMatrixf (r_world_matrix); - if (r_wateralpha->value < 1.0) { + if (cl_wateralpha < 1.0) { qfglDepthMask (GL_FALSE); - color_white[3] = r_wateralpha->value * 255; + color_white[3] = cl_wateralpha * 255; qfglColor4ubv (color_white); } @@ -601,7 +601,7 @@ R_DrawWaterSurfaces (void) waterchain = NULL; waterchain_tail = &waterchain; - if (r_wateralpha->value < 1.0) { + if (cl_wateralpha < 1.0) { qfglDepthMask (GL_TRUE); qfglColor3ubv (color_white); } @@ -798,7 +798,7 @@ R_RecursiveWorldNode (mnode_t *node) continue; // wrong side if (surf->flags & SURF_DRAWTURB) { -// if (r_wateralpha->value < 1.0) // FIXME: DESPAIR +// if (cl_wateralpha < 1.0) // FIXME: DESPAIR CHAIN_SURF_B2F (surf, waterchain); // else // CHAIN_SURF (surf, waterchain); diff --git a/libs/video/renderer/r_cvar.c b/libs/video/renderer/r_cvar.c index b55d3fecb..5b6f8dd8e 100644 --- a/libs/video/renderer/r_cvar.c +++ b/libs/video/renderer/r_cvar.c @@ -131,6 +131,7 @@ cvar_t *scr_showram; cvar_t *scr_showturtle; cvar_t *scr_viewsize; +float cl_wateralpha; static void r_particles_f (cvar_t *var) diff --git a/nq/source/host.c b/nq/source/host.c index f7323a261..514f00c8a 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -660,6 +660,8 @@ _Host_Frame (float time) r_view_model = &cl.viewent; r_frametime = host_frametime; + cl_wateralpha = r_wateralpha->value; + CL_UpdateScreen (cl.time); if (host_speeds->int_val) diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index a7bf9b8a4..e18ee1171 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1551,8 +1551,12 @@ Host_Frame (float time) r_frametime = host_frametime; // don't allow cheats in multiplayer - if (r_active && !cl.watervis && r_wateralpha->value != 1.0) - Cvar_SetValue (r_wateralpha, 1); + if (r_active) { + if (!cl.watervis) + cl_wateralpha = r_wateralpha->value; + else + cl_wateralpha = 1.0; + } CL_UpdateScreen (realtime);