mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-28 03:40:47 +00:00
- spriteset management.
This commit is contained in:
parent
e396798198
commit
21fddd6c54
6 changed files with 12 additions and 4 deletions
|
@ -509,6 +509,7 @@ DEFINE_FIELD_NAMED(DCoreActor, sprext.roll, roll)
|
|||
DEFINE_FIELD_NAMED(DCoreActor, sprext.renderflags, renderflags)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, sprext.alpha, alpha)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, time, spawnindex)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spritesetindex, spritesetpic)
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DCoreActor, pos)
|
||||
{
|
||||
|
@ -585,7 +586,11 @@ DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, addz, coreactor_addz)
|
|||
void coreactor_setSpritePic(DCoreActor* self, unsigned z)
|
||||
{
|
||||
auto &spriteset = static_cast<PClassActor*>(self->GetClass())->ActorInfo()->SpriteSet;
|
||||
if (z < spriteset.Size()) self->spr.picnum = spriteset[z];
|
||||
if (z < spriteset.Size())
|
||||
{
|
||||
self->spritesetindex = z;
|
||||
self->spr.picnum = spriteset[z];
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, setSpritePic, coreactor_setSpritePic)
|
||||
|
|
|
@ -30,6 +30,8 @@ public:
|
|||
vec3_t opos;
|
||||
int time;
|
||||
int16_t oang;
|
||||
int16_t spritesetindex;
|
||||
|
||||
|
||||
DCoreActor() = default;
|
||||
virtual ~DCoreActor() = default;
|
||||
|
|
|
@ -674,6 +674,7 @@ void DCoreActor::Serialize(FSerializer& arc)
|
|||
("nextsect", nextSect)
|
||||
("sprite", spr)
|
||||
("time", time)
|
||||
("spritesetindex", spritesetindex)
|
||||
("spriteext", sprext);
|
||||
|
||||
if (arc.isReading()) spsmooth = {};
|
||||
|
|
|
@ -306,7 +306,6 @@ void DDukeActor::Serialize(FSerializer& arc)
|
|||
("actorstayput", actorstayput)
|
||||
("dispicnum", dispicnum)
|
||||
("basepicnum", basepicnum)
|
||||
("spritesetindex", spritesetindex)
|
||||
("timetosleep", timetosleep)
|
||||
("floorz", floorz)
|
||||
("ceilingz", ceilingz)
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
uint8_t cgg;
|
||||
uint8_t spriteextra; // moved here for easier maintenance. This was originally a hacked in field in the sprite structure called 'filler'.
|
||||
short attackertype, hitang, hitextra, movflag;
|
||||
short tempang, dispicnum, basepicnum, spritesetindex;
|
||||
short tempang, dispicnum, basepicnum;
|
||||
short timetosleep;
|
||||
vec2_t ovel;
|
||||
int floorz, ceilingz;
|
||||
|
|
|
@ -4,7 +4,7 @@ class CoreActor native
|
|||
//native readonly sectortype sectp;
|
||||
|
||||
native int16 cstat;
|
||||
native int16 picnum;
|
||||
//native int16 picnum; // access is disabled to allow later refactoring.
|
||||
native readonly int16 statnum;
|
||||
native int16 ang;
|
||||
native int16 xvel;
|
||||
|
@ -33,6 +33,7 @@ class CoreActor native
|
|||
native uint8 renderflags;
|
||||
native float alpha;
|
||||
|
||||
native readonly int16 spritesetpic;
|
||||
native readonly int spawnindex;
|
||||
|
||||
// note that the pos vector is not directly accessible here.
|
||||
|
|
Loading…
Reference in a new issue