Skip to content

Commit

Permalink
Added GetDecalName()
Browse files Browse the repository at this point in the history
  • Loading branch information
Boondorl authored and madame-rachelle committed Sep 25, 2024
1 parent 3524d06 commit 8c10ac6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gamedata/decallib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ const FDecalTemplate *FDecalBase::GetDecal () const
return NULL;
}

FName FDecalBase::GetDecalName() const
{
return Name;
}

void FDecalTemplate::ReplaceDecalRef(FDecalBase *from, FDecalBase *to)
{
if (LowerDecal == from)
Expand Down
1 change: 1 addition & 0 deletions src/gamedata/decallib.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class FDecalBase
public:
virtual const FDecalTemplate *GetDecal () const;
virtual void ReplaceDecalRef (FDecalBase *from, FDecalBase *to) = 0;
FName GetDecalName() const;

protected:
FDecalBase ();
Expand Down
17 changes: 17 additions & 0 deletions src/playsim/a_decals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,3 +934,20 @@ DEFINE_ACTION_FUNCTION_NATIVE(ADecal, SpawnDecal, SpawnDecal)
SpawnDecal(self);
return 0;
}

//----------------------------------------------------------------------------
//
//
//
//----------------------------------------------------------------------------

static int GetDecalName(AActor* self)
{
return self->DecalGenerator != nullptr ? self->DecalGenerator->GetDecalName().GetIndex() : NAME_None;
}

DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetDecalName, GetDecalName)
{
PARAM_SELF_PROLOGUE(AActor);
ACTION_RETURN_INT(GetDecalName(self));
}
1 change: 1 addition & 0 deletions wadsrc/static/zscript/actors/actor.zs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ class Actor : Thinker native
native void ClearFOVInterpolation();
native clearscope Vector3 PosRelative(sector sec) const;
native void RailAttack(FRailParams p);
native clearscope Name GetDecalName() const;

native void HandleSpawnFlags();
native void ExplodeMissile(line lin = null, Actor target = null, bool onsky = false);
Expand Down

0 comments on commit 8c10ac6

Please sign in to comment.