Skip to content

Commit

Permalink
rgb for damaghue + override powerup glows
Browse files Browse the repository at this point in the history
  • Loading branch information
timbergeron committed Oct 11, 2023
1 parent f6003e1 commit 33e675d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 32 deletions.
1 change: 1 addition & 0 deletions Quake/gl_rmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ mleaf_t *r_viewleaf, *r_oldviewleaf;
int d_lightstylevalue[MAX_LIGHTSTYLES]; // 8.8 fraction of base light value

cvar_t cl_damagehue = {"cl_damagehue", "1",CVAR_ARCHIVE}; // woods #damage
cvar_t cl_damagehuecolor = {"cl_damagehuecolor", "0xeb580e",CVAR_ARCHIVE}; // woods #damage
cvar_t cl_autodemo = {"cl_autodemo","0",CVAR_ARCHIVE}; //R00k // woods #autodemo

cvar_t r_norefresh = {"r_norefresh","0",CVAR_NONE};
Expand Down
1 change: 1 addition & 0 deletions Quake/gl_rmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ void R_Init (void)
//johnfitz

Cvar_RegisterVariable (&cl_damagehue); // woods #damage
Cvar_RegisterVariable (&cl_damagehuecolor); // woods #damage
Cvar_RegisterVariable(&cl_autodemo); // woods #autodemo

Cvar_RegisterVariable (&gl_zfix); // QuakeSpasm z-fighting fix
Expand Down
1 change: 1 addition & 0 deletions Quake/quakedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ void ServerList_Rebuild (void); // woods #serverlist

extern cvar_t gl_lightning_alpha; // woods #lightalpha
extern cvar_t cl_damagehue; // woods #damage
extern cvar_t cl_damagehuecolor; // woods #damage
extern vec3_t NULLVEC; // woods truelighting #truelight
extern char dequake[256]; // JPG 1.05 - dedicated console translation // woods for #iplog
extern cvar_t cl_autodemo; //r00k / woods #autodemo
Expand Down
63 changes: 35 additions & 28 deletions Quake/r_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,9 @@ void R_SetupAliasLighting (entity_t *e)
float radiansangle;
float *origin;

plcolour_t dhvalue = CL_PLColours_Parse(cl_damagehuecolor.string); // woods #damage
byte* dhuecolor = CL_PLColours_ToRGB(&dhvalue); // woods #damage

if (!r_refdef.drawworld)
lightcolor[0] = lightcolor[1] = lightcolor[2] = 255;
else
Expand Down Expand Up @@ -1182,54 +1185,58 @@ void R_SetupAliasLighting (entity_t *e)
}
}

// begin woods for orange hue damage taken #damage
// begin woods for hue damage taken #damage

if (cl.time <= cl.faceanimtime && cl_damagehue.value)
if (e == &cl.viewent)
{
{
lightcolor[0] = 169;
lightcolor[1] = 114;
lightcolor[2] = 64;
lightcolor[0] = dhuecolor[0];
lightcolor[1] = dhuecolor[1];
lightcolor[2] = dhuecolor[2];
}
}

// end woods for red damage taken
// end woods for damage taken

// begin woods add hue to gun model with powerups

if ((cl.gametype == GAME_DEATHMATCH) && r_coloredpowerupglow.value)
{
if (cl.items & IT_QUAD)
if (e == &cl.viewent)
{
if (!(cl.time <= cl.faceanimtime && cl_damagehue.value))
{
if ((cl.gametype == GAME_DEATHMATCH) && r_coloredpowerupglow.value)
{
if (cl.items & IT_QUAD)
if (e == &cl.viewent)
{
lightcolor[0] = 50;
lightcolor[1] = 50;
lightcolor[2] = 121;
{
lightcolor[0] = 50;
lightcolor[1] = 50;
lightcolor[2] = 121;
}
}
}

if (cl.items & IT_INVULNERABILITY)
if (e == &cl.viewent)
{
if (cl.items & IT_INVULNERABILITY)
if (e == &cl.viewent)
{
lightcolor[0] = 131;
lightcolor[1] = 73;
lightcolor[2] = 73;
{
lightcolor[0] = 131;
lightcolor[1] = 73;
lightcolor[2] = 73;
}
}
}

if ((cl.items & (IT_QUAD | IT_INVULNERABILITY)) == (IT_QUAD | IT_INVULNERABILITY))
if (e == &cl.viewent)
{
if ((cl.items & (IT_QUAD | IT_INVULNERABILITY)) == (IT_QUAD | IT_INVULNERABILITY))
if (e == &cl.viewent)
{
lightcolor[0] = 211;
lightcolor[1] = 113;
lightcolor[2] = 194;
{
lightcolor[0] = 211;
lightcolor[1] = 113;
lightcolor[2] = 194;
}
}
}
}
}

// end woods add hue to gun model with powerups

// clamp lighting so it doesn't overbright as much (96)
Expand Down
11 changes: 7 additions & 4 deletions Quake/sbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,7 @@ Sbar_DrawFace
void Sbar_DrawFace (void)
{
int f, anim;
plcolour_t color = CL_PLColours_Parse(cl_damagehuecolor.string);

// PGM 01/19/97 - team color drawing
// PGM 03/02/97 - fixed so color swatch only appears in CTF modes
Expand Down Expand Up @@ -1507,8 +1508,8 @@ void Sbar_DrawFace (void)
anim = 0;
Sbar_DrawPic (112, 0, sb_faces[f][anim]);

if (cl.time <= cl.faceanimtime) // woods for damagehue on sbar face
Draw_Fill(112, 24, 24, 25, 25, .2);
if (cl.time <= cl.faceanimtime && cl_damagehue.value && cl_damagehuecolor.value) // woods for damagehue on sbar face
Draw_FillPlayer(112, 24, 24, 25, color, .2);
}

/*
Expand Down Expand Up @@ -1719,6 +1720,8 @@ void Sbar_Draw (void)

if (scr_sbar.value == 3 && scr_viewsize.value <= 110) // qe hud does not use 'traditional sbar' #qehud
{
plcolour_t color = CL_PLColours_Parse(cl_damagehuecolor.string);

GL_SetCanvas(CANVAS_BOTTOMLEFTQE);

// armor
Expand Down Expand Up @@ -1765,8 +1768,8 @@ void Sbar_Draw (void)
// face
Sbar_DrawPic(18, 140, Sbar_FacePic());

if (cl.time <= cl.faceanimtime) // woods for damagehue on sbar face
Draw_Fill (18, 163, 24, 25, 24, .2);
if (cl.time <= cl.faceanimtime && cl_damagehue.value && cl_damagehuecolor.value) // woods for damagehue on sbar face
Draw_FillPlayer (18, 163, 24, 25, color, .2);

// health

Expand Down

0 comments on commit 33e675d

Please sign in to comment.