mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- add more wrappers and use 'inittype' where the actual zvel member of spritetype is wanted.
This will avoid problems with search&replace later.
This commit is contained in:
parent
8946a66350
commit
05f488ce3c
6 changed files with 20 additions and 9 deletions
|
@ -499,7 +499,7 @@ DEFINE_FIELD_NAMED(DCoreActor, spr.statnum, statnum)
|
|||
DEFINE_FIELD_NAMED(DCoreActor, spr.pos, pos)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.xvel, xvel)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.yvel, yvel)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.zvel, zvel)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, zvel)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, inittype)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.hitag, hitag)
|
||||
DEFINE_FIELD_NAMED(DCoreActor, spr.lotag, lotag)
|
||||
|
|
|
@ -111,24 +111,35 @@ public:
|
|||
spr.angle = spr.angle.Normalized360();
|
||||
}
|
||||
|
||||
// these use Blood's inittype alias to not get caught up in searches.
|
||||
int int_zvel() const
|
||||
{
|
||||
return spr. zvel;
|
||||
return spr.inittype;
|
||||
}
|
||||
|
||||
double float_zvel() const
|
||||
{
|
||||
return spr.inittype * zinttoworld;
|
||||
}
|
||||
|
||||
void clear_zvel()
|
||||
{
|
||||
spr.inittype = 0;
|
||||
}
|
||||
|
||||
void set_int_zvel(int v)
|
||||
{
|
||||
spr. zvel = v;
|
||||
spr.inittype = v;
|
||||
}
|
||||
|
||||
void add_int_zvel(int v)
|
||||
{
|
||||
spr.zvel += v;
|
||||
spr.inittype += v;
|
||||
}
|
||||
|
||||
void mul_int_zvel(double v)
|
||||
{
|
||||
spr.zvel = int(spr.zvel * v);
|
||||
spr.inittype = int(spr.inittype * v);
|
||||
}
|
||||
// Same as above but with inverted y and z axes to match the renderer's coordinate system.
|
||||
|
||||
|
|
|
@ -615,7 +615,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor)
|
|||
tspr->angle = actor->spr.angle;
|
||||
tspr->xvel = actor->spr.xvel;
|
||||
tspr->yvel = actor->spr.yvel;
|
||||
tspr->zvel = actor->int_zvel();
|
||||
tspr->inittype = actor->spr.inittype;
|
||||
tspr->lotag = actor->spr.lotag;
|
||||
tspr->hitag = actor->spr.hitag;
|
||||
tspr->extra = actor->spr.extra;
|
||||
|
|
|
@ -466,7 +466,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet
|
|||
("owner", c.intowner, def->intowner)
|
||||
("xvel", c.xvel, def->xvel)
|
||||
("yvel", c.yvel, def->yvel)
|
||||
("zvel", c.zvel, def->zvel)
|
||||
("zvel", c.inittype, def->inittype)
|
||||
("lotag", c.lotag, def->lotag)
|
||||
("hitag", c.hitag, def->hitag)
|
||||
("extra", c.extra, def->extra)
|
||||
|
|
|
@ -367,7 +367,7 @@ DEFINE_PROPERTY(yvel, I, CoreActor)
|
|||
DEFINE_PROPERTY(zvel, I, CoreActor)
|
||||
{
|
||||
PROP_INT_PARM(i, 0);
|
||||
bag.Info->ActorInfo()->defsprite.zvel = i;
|
||||
bag.Info->ActorInfo()->defsprite.inittype = i;
|
||||
bag.Info->ActorInfo()->DefaultFlags |= DEFF_ZVEL;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ DEFINE_FIELD_X(tspritetype, tspritetype, statnum)
|
|||
DEFINE_FIELD_X(tspritetype, tspritetype, angle)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, xvel)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, yvel)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, zvel)
|
||||
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, inittype,zvel)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, lotag)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, hitag)
|
||||
DEFINE_FIELD_X(tspritetype, tspritetype, extra)
|
||||
|
|
Loading…
Reference in a new issue