From 6485570c93dc80ccebd89ab65ffeb8aa11549775 Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Wed, 19 Dec 2018 11:58:06 -0500 Subject: [PATCH] Implement additive colours on HUD sprites Also, make sure the alpha for the additive colour is 255. --- src/hwrenderer/scene/hw_sprites.cpp | 2 +- src/hwrenderer/scene/hw_walls.cpp | 2 +- src/hwrenderer/scene/hw_weapon.cpp | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hwrenderer/scene/hw_sprites.cpp b/src/hwrenderer/scene/hw_sprites.cpp index 27c3175d4..42286aab7 100644 --- a/src/hwrenderer/scene/hw_sprites.cpp +++ b/src/hwrenderer/scene/hw_sprites.cpp @@ -159,7 +159,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent) : ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]); state.SetObjectColor(finalcol); - state.SetAddColor(cursec->SpecialColors[sector_t::add]); + state.SetAddColor(cursec->SpecialColors[sector_t::add] | 0xff000000); } state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, trans); } diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index eaf6f629b..e71f94ad3 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -174,7 +174,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags) PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector); state.SetObjectColor(color1); state.SetObjectColor2(color2); - state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add]); + state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add] | 0xff000000); if (color1 != color2) { // Do gradient setup only if there actually is a gradient. diff --git a/src/hwrenderer/scene/hw_weapon.cpp b/src/hwrenderer/scene/hw_weapon.cpp index e232ba088..4c585a74d 100644 --- a/src/hwrenderer/scene/hw_weapon.cpp +++ b/src/hwrenderer/scene/hw_weapon.cpp @@ -72,7 +72,11 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state) state.SetRenderStyle(huds->RenderStyle); state.SetTextureMode(huds->RenderStyle); state.SetObjectColor(huds->ObjectColor); - // state.SetAddColor(0); + if (huds->owner->Sector) { + state.SetAddColor(huds->owner->Sector->SpecialColors[sector_t::add] | 0xff000000); + } else { + state.SetAddColor(0); + } state.SetDynLight(huds->dynrgb[0], huds->dynrgb[1], huds->dynrgb[2]); state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed));