- fixed: DPSprite::GetRenderStyle returned the wrong alpha value.

This commit is contained in:
Christoph Oelckers 2017-05-03 10:26:25 +02:00
parent 00dab8677a
commit f9445e96f5

View file

@ -322,7 +322,6 @@ std::pair<FRenderStyle, float> DPSprite::GetRenderStyle(FRenderStyle ownerstyle,
mystyle.CheckFuzz();
if (Flags & PSPF_RENDERSTYLE)
{
ownerstyle.CheckFuzz();
if (Flags & PSPF_FORCESTYLE)
{
returnstyle = mystyle;
@ -372,6 +371,10 @@ std::pair<FRenderStyle, float> DPSprite::GetRenderStyle(FRenderStyle ownerstyle,
returnalpha = owneralpha * alpha;
}
}
else
{
returnalpha = owneralpha;
}
// Should normal renderstyle come out on top at the end and we desire alpha,
// switch it to translucent. Normal never applies any sort of alpha.
@ -381,7 +384,7 @@ std::pair<FRenderStyle, float> DPSprite::GetRenderStyle(FRenderStyle ownerstyle,
returnalpha = owneralpha * alpha;
}
return{ returnstyle, clamp<float>(float(alpha), 0.f, 1.f) };
return{ returnstyle, clamp<float>(float(returnalpha), 0.f, 1.f) };
}
//---------------------------------------------------------------------------