- moved the GetBlend script call to the one single place where it is needed to get rid of one native AInventory method.

This commit is contained in:
Christoph Oelckers 2018-11-29 23:48:55 +01:00
commit 7b63e088e1
5 changed files with 12 additions and 28 deletions

View file

@ -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);