mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- fixed: All powerup blend colors with an alpha of 0 were treated as 'has no color' for PowerupGivers.
This commit is contained in:
parent
c631ffc5fd
commit
fbe14d59bb
2 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,8 @@ bool APowerupGiver::Use (bool pickup)
|
|||
}
|
||||
if (BlendColor != 0)
|
||||
{
|
||||
power->BlendColor = BlendColor;
|
||||
if (BlendColor.a != 0) power->BlendColor = BlendColor;
|
||||
else power->BlendColor = 0;
|
||||
}
|
||||
if (Mode != NAME_None)
|
||||
{
|
||||
|
|
|
@ -2020,15 +2020,18 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory)
|
|||
"INVERSEMAP", "GOLDMAP", "REDMAP", "GREENMAP", "BLUEMAP", NULL };
|
||||
|
||||
int alpha;
|
||||
bool giver;
|
||||
PalEntry * pBlendColor;
|
||||
|
||||
if (info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
|
||||
{
|
||||
pBlendColor = &((APowerup*)defaults)->BlendColor;
|
||||
giver = false;
|
||||
}
|
||||
else if (info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)))
|
||||
{
|
||||
pBlendColor = &((APowerupGiver*)defaults)->BlendColor;
|
||||
giver = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2061,7 +2064,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory)
|
|||
else alpha = 255/3;
|
||||
|
||||
alpha=clamp<int>(alpha, 0, 255);
|
||||
if (alpha != 0) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color;
|
||||
if (alpha != 0 || giver) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color;
|
||||
else *pBlendColor = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue