From 5fe5dbd5aa91da7d687667e5ced16bb7952d4939 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 26 Jan 2022 00:36:34 +0100 Subject: [PATCH] - 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. --- source/core/actorinfo.h | 1 + source/games/duke/src/game.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/source/core/actorinfo.h b/source/core/actorinfo.h index eaf58a47018..5a5cb15a7e7 100644 --- a/source/core/actorinfo.h +++ b/source/core/actorinfo.h @@ -36,6 +36,7 @@ enum EDefaultFlags struct FActorInfo { TArray LightAssociations; + TArray SpriteSet; PClassActor *Replacement = nullptr; PClassActor *Replacee = nullptr; int TypeNum = -1; diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index f99ae1433e2..735545cef60 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -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