mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 01:11:15 +00:00
- made DCoreActor's properties functional.
They cannot be parsed directly into the actor's sprite because that gets used in ways that require a different setup. This alsp adds a property parser and a setter function for the SpriteSet array. The idea here is to write code that does not need to use actual tile indices so it can later be refactored to real textures.
This commit is contained in:
parent
e3f1893e02
commit
e396798198
5 changed files with 60 additions and 24 deletions
|
@ -581,3 +581,17 @@ DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, addz, coreactor_addz)
|
|||
self->spr.pos.Z = int(z * 256);
|
||||
return 0;
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DCoreActor, setSpritePic, coreactor_setSpritePic)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DCoreActor);
|
||||
PARAM_INT(z);
|
||||
coreactor_setSpritePic(self, z);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue