- added spriteSet property to DukeActor

The idea here is to abstract picnum manipulation. Since all this is strongly index based it translates poorly to a system with named textures.
This allows a class to define a set of sprite images it intends to operate on as if it was still a simple indexed resource, even if the underlying storage changes.
This commit is contained in:
Christoph Oelckers 2022-01-26 00:36:34 +01:00
parent c27976b2e5
commit 5fe5dbd5aa
2 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,7 @@ enum EDefaultFlags
struct FActorInfo
{
TArray<FInternalLightAssociation *> LightAssociations;
TArray<int> SpriteSet;
PClassActor *Replacement = nullptr;
PClassActor *Replacee = nullptr;
int TypeNum = -1;

View file

@ -42,6 +42,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#include "razefont.h"
#include "psky.h"
#include "vm.h"
#include "thingdef.h"
BEGIN_DUKE_NS
@ -426,4 +427,17 @@ DEFINE_FIELD(DDukeActor, flags1)
DEFINE_FIELD(DDukeActor, flags2)
DEFINE_GLOBAL_UNSIZED(dlevel)
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(spriteset, Ssssssssssssssssssss, DukeActor)
{
for (int i = 0; i < PROP_PARM_COUNT; ++i)
{
PROP_STRING_PARM(n, i);
bag.Info->ActorInfo()->SpriteSet.Push(TileFiles.tileForName(n));
}
}
END_DUKE_NS