mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- fixed applying of alpha to weapon sprites
https://forum.zdoom.org/viewtopic.php?t=60638 https://forum.zdoom.org/viewtopic.php?t=60642
This commit is contained in:
parent
ad31da20e5
commit
2cdc9f9dda
1 changed files with 2 additions and 7 deletions
|
@ -252,14 +252,13 @@ bool HUDSprite::GetWeaponRenderStyle(DPSprite *psp, AActor *playermo, sector_t *
|
|||
auto rs = psp->GetRenderStyle(playermo->RenderStyle, playermo->Alpha);
|
||||
|
||||
visstyle_t vis;
|
||||
float trans = 0.f;
|
||||
|
||||
vis.RenderStyle = STYLE_Count;
|
||||
vis.Alpha = rs.second;
|
||||
vis.Invert = false;
|
||||
playermo->AlterWeaponSprite(&vis);
|
||||
|
||||
if (!(psp->Flags & PSPF_FORCEALPHA)) trans = vis.Alpha;
|
||||
alpha = (psp->Flags & PSPF_FORCEALPHA) ? 0.f : vis.Alpha;
|
||||
|
||||
if (vis.RenderStyle != STYLE_Count && !(psp->Flags & PSPF_FORCESTYLE))
|
||||
{
|
||||
|
@ -303,14 +302,10 @@ bool HUDSprite::GetWeaponRenderStyle(DPSprite *psp, AActor *playermo, sector_t *
|
|||
{
|
||||
alpha = 1.f;
|
||||
}
|
||||
else if (trans == 0.f)
|
||||
else if (alpha == 0.f)
|
||||
{
|
||||
alpha = vis.Alpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = trans;
|
||||
}
|
||||
if (!RenderStyle.IsVisible(alpha)) return false; // if it isn't visible skip the rest.
|
||||
|
||||
PalEntry ThingColor = (playermo->RenderStyle.Flags & STYLEF_ColorIsFixed) ? playermo->fillcolor : 0xffffff;
|
||||
|
|
Loading…
Reference in a new issue