From 2cdc9f9dda41f69a45de9de7b54a8ec4dc28a3cd Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 21 May 2018 10:49:29 +0300 Subject: [PATCH] - fixed applying of alpha to weapon sprites https://forum.zdoom.org/viewtopic.php?t=60638 https://forum.zdoom.org/viewtopic.php?t=60642 --- src/hwrenderer/scene/hw_weapon.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hwrenderer/scene/hw_weapon.cpp b/src/hwrenderer/scene/hw_weapon.cpp index 781f3395a..ed71ceb11 100644 --- a/src/hwrenderer/scene/hw_weapon.cpp +++ b/src/hwrenderer/scene/hw_weapon.cpp @@ -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;