From e6de24a7dee333fb73b3a35682563f3008261053 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 6 Dec 2014 22:08:39 +0100 Subject: [PATCH] - turned out that the recent change to allow cancelling a powerup blend through a powerup giver did not work well so now there's an explicit 'Powerup.Color none' to do it that works a bit differently. --- src/g_shared/a_artifacts.cpp | 2 +- src/thingdef/thingdef_properties.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 410474f31..21006776e 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -60,7 +60,7 @@ bool APowerupGiver::Use (bool pickup) } if (BlendColor != 0) { - if (BlendColor.a != 0) power->BlendColor = BlendColor; + if (BlendColor != MakeSpecialColormap(65535)) power->BlendColor = BlendColor; else power->BlendColor = 0; } if (Mode != NAME_None) diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index ec68dfb95..5b17185c4 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2020,18 +2020,15 @@ 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 { @@ -2053,6 +2050,10 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) *pBlendColor = MakeSpecialColormap(v); return; } + else if (!stricmp(name, "none") && info->Class->IsDescendantOf(RUNTIME_CLASS(APowerupGiver))) + { + *pBlendColor = MakeSpecialColormap(65535); + } color = V_GetColor(NULL, name); } @@ -2064,7 +2065,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) else alpha = 255/3; alpha=clamp(alpha, 0, 255); - if (alpha != 0 || giver) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color; + if (alpha != 0) *pBlendColor = MAKEARGB(alpha, 0, 0, 0) | color; else *pBlendColor = 0; }