diff --git a/src/actor.h b/src/actor.h index 5f663323b..b3d3c5a94 100644 --- a/src/actor.h +++ b/src/actor.h @@ -789,7 +789,7 @@ public: void ObtainInventory (AActor *other); // Die. Now. - virtual bool Massacre (); + bool Massacre (); // Transforms the actor into a finely-ground paste bool Grind(bool items); diff --git a/src/g_inventory/a_pickups.cpp b/src/g_inventory/a_pickups.cpp index 53689157a..20f6b9f48 100644 --- a/src/g_inventory/a_pickups.cpp +++ b/src/g_inventory/a_pickups.cpp @@ -183,28 +183,6 @@ void AInventory::DepleteOrDestroy () } } -//=========================================================================== -// -// AInventory :: GetBlend -// -// Returns a color to blend to the player's view as long as they possess this -// item. -// -//=========================================================================== - -PalEntry AInventory::CallGetBlend() -{ - IFVIRTUAL(AInventory, GetBlend) - { - VMValue params[1] = { (DObject*)this }; - int retval; - VMReturn ret(&retval); - VMCall(func, params, 1, &ret, 1); - return retval; - } - else return 0; -} - //=========================================================================== // // AInventory :: PrevInv diff --git a/src/g_inventory/a_pickups.h b/src/g_inventory/a_pickups.h index 4981e81c3..9960d7a0c 100644 --- a/src/g_inventory/a_pickups.h +++ b/src/g_inventory/a_pickups.h @@ -76,8 +76,6 @@ public: bool CallTryPickup(AActor *toucher, AActor **toucher_return = NULL); // Wrapper for script function. void DepleteOrDestroy (); // virtual on the script side. - PalEntry CallGetBlend(); // virtual on the script side. - bool GetNoTeleportFreeze(); // virtual on the script side. bool DoRespawn(); diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index f3fbbff37..069824757 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -282,8 +282,6 @@ int HWDrawInfo::SetFullbrightFlags(player_t *player) auto litetype = PClass::FindActor(NAME_PowerLightAmp); for (AInventory * in = cplayer->mo->Inventory; in; in = in->Inventory) { - //PalEntry color = in->CallGetBlend(); - // Need special handling for light amplifiers if (in->IsKindOf(torchtype)) { diff --git a/src/v_blend.cpp b/src/v_blend.cpp index e077ef827..11307721c 100644 --- a/src/v_blend.cpp +++ b/src/v_blend.cpp @@ -43,6 +43,7 @@ #include "gi.h" #include "d_player.h" #include "g_levellocals.h" +#include "vm.h" CVAR( Float, blood_fade_scalar, 1.0f, CVAR_ARCHIVE ) // [SP] Pulled from Skulltag - changed default from 0.5 to 1.0 CVAR( Float, pickup_fade_scalar, 1.0f, CVAR_ARCHIVE ) // [SP] Uses same logic as blood_fade_scalar except for pickups @@ -96,7 +97,16 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int // [RH] All powerups can affect the screen blending now for (AInventory *item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory) { - PalEntry color = item->CallGetBlend (); + PalEntry color = 0; + + IFVIRTUALPTR(item, AInventory, GetBlend) + { + VMValue params[1] = { item }; + VMReturn ret((int*)&color.d); + VMCall(func, params, 1, &ret, 1); + } + + if (color.a != 0) { V_AddBlend (color.r/255.f, color.g/255.f, color.b/255.f, color.a/255.f, blend);