Skip to content

Commit

Permalink
- added spriteSet property to DukeActor
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
coelckers committed Jan 25, 2022
1 parent c27976b commit 5fe5dbd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/core/actorinfo.h
Expand Up @@ -36,6 +36,7 @@ enum EDefaultFlags
struct FActorInfo
{
TArray<FInternalLightAssociation *> LightAssociations;
TArray<int> SpriteSet;
PClassActor *Replacement = nullptr;
PClassActor *Replacee = nullptr;
int TypeNum = -1;
Expand Down
14 changes: 14 additions & 0 deletions source/games/duke/src/game.cpp
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 5fe5dbd

Please sign in to comment.