mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Sanitize color handling a little.
This commit is contained in:
parent
4b948de225
commit
8f0ce733ff
1 changed files with 4 additions and 5 deletions
|
@ -826,9 +826,9 @@ draw_elechain (elechain_t *ec, int matloc, int vertloc, int tlstloc,
|
|||
static void
|
||||
bsp_begin (void)
|
||||
{
|
||||
static quat_t color = { 1, 1, 1, 1 };
|
||||
quat_t fog;
|
||||
|
||||
default_color[3] = 1;
|
||||
last_color = default_color;
|
||||
|
||||
Mat4Mult (glsl_projection, glsl_view, bsp_vp);
|
||||
|
@ -838,7 +838,7 @@ bsp_begin (void)
|
|||
qfglEnableVertexAttribArray (quake_bsp.tlst.location);
|
||||
qfglDisableVertexAttribArray (quake_bsp.color.location);
|
||||
|
||||
qfglVertexAttrib4fv (quake_bsp.color.location, color);
|
||||
qfglVertexAttrib4fv (quake_bsp.color.location, default_color);
|
||||
|
||||
VectorCopy (Fog_GetColor (), fog);
|
||||
fog[3] = Fog_GetDensity () / 64.0;
|
||||
|
@ -880,9 +880,9 @@ bsp_end (void)
|
|||
static void
|
||||
turb_begin (void)
|
||||
{
|
||||
static quat_t color = { 1, 1, 1, 1 };
|
||||
quat_t fog;
|
||||
|
||||
default_color[3] = bound (0, r_wateralpha->value, 1);
|
||||
last_color = default_color;
|
||||
|
||||
Mat4Mult (glsl_projection, glsl_view, bsp_vp);
|
||||
|
@ -892,8 +892,7 @@ turb_begin (void)
|
|||
qfglEnableVertexAttribArray (quake_turb.tlst.location);
|
||||
qfglDisableVertexAttribArray (quake_bsp.color.location);
|
||||
|
||||
color[3] = bound (0, r_wateralpha->value, 1);
|
||||
qfglVertexAttrib4fv (quake_turb.color.location, color);
|
||||
qfglVertexAttrib4fv (quake_turb.color.location, default_color);
|
||||
|
||||
VectorCopy (Fog_GetColor (), fog);
|
||||
fog[3] = Fog_GetDensity () / 64.0;
|
||||
|
|
Loading…
Reference in a new issue