Added A_Overlay

This commit is contained in:
Leonard2 2016-05-11 23:13:02 +02:00
parent 1966b61b8f
commit 1ecfb5897b
2 changed files with 26 additions and 0 deletions

View file

@ -251,6 +251,11 @@ void DPSprite::SetState(FState *newstate, bool pending)
FState *nextstate;
if (newstate->CallAction(Owner->mo, Caller, &nextstate))
{
// It's possible this call resulted in this very layer being replaced.
if (ObjectFlags & OF_EuthanizeMe)
{
return;
}
if (nextstate != nullptr)
{
newstate = nextstate;
@ -1001,8 +1006,28 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
return 0;
}
//---------------------------------------------------------------------------
//
// PROC A_Overlay
//
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_Overlay)
{
PARAM_ACTION_PROLOGUE;
PARAM_INT (layer);
PARAM_STATE_OPT (state) { state = nullptr; }
player_t *player = self->player;
if (player == nullptr)
return 0;
DPSprite *pspr;
pspr = new DPSprite(player, reinterpret_cast<AInventory *>(stateowner), layer);
pspr->SetState(state);
return 0;
}
//
// A_GunFlash

View file

@ -40,6 +40,7 @@ ACTOR Inventory native
action native A_ReFire(state flash = "");
action native A_ClearReFire();
action native A_CheckReload();
action native A_Overlay(int layer, state start = "");
action native A_GunFlash(state flash = "", int flags = 0);
action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff", int flags = 0, float range = 0, float/*angle*/ spread_xy = 2.8125, float/*angle*/ spread_z = 0, float lifesteal = 0, int lifestealmax = 0, class<BasicArmorBonus> armorbonustype = "ArmorBonus");
action native state A_CheckForReload(int counter, state label, bool dontincrement = false);