Implement additive colours on HUD sprites

Also, make sure the alpha for the additive colour is 255.
This commit is contained in:
Kevin Caccamo 2018-12-19 11:58:06 -05:00 committed by Christoph Oelckers
parent 33723e8904
commit 6485570c93
3 changed files with 7 additions and 3 deletions

View File

@ -159,7 +159,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
: ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]); : ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]);
state.SetObjectColor(finalcol); 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); state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, trans);
} }

View File

@ -174,7 +174,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector); PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
state.SetObjectColor(color1); state.SetObjectColor(color1);
state.SetObjectColor2(color2); state.SetObjectColor2(color2);
state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add]); state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add] | 0xff000000);
if (color1 != color2) if (color1 != color2)
{ {
// Do gradient setup only if there actually is a gradient. // Do gradient setup only if there actually is a gradient.

View File

@ -72,7 +72,11 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
state.SetRenderStyle(huds->RenderStyle); state.SetRenderStyle(huds->RenderStyle);
state.SetTextureMode(huds->RenderStyle); state.SetTextureMode(huds->RenderStyle);
state.SetObjectColor(huds->ObjectColor); 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.SetDynLight(huds->dynrgb[0], huds->dynrgb[1], huds->dynrgb[2]);
state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed)); state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed));