- final xvel cleanup.

This commit is contained in:
Christoph Oelckers 2022-09-01 17:17:06 +02:00
parent 9600face4a
commit f8ba5bb660
10 changed files with 25 additions and 26 deletions

View file

@ -497,9 +497,8 @@ DEFINE_FIELD_NAMED(DCoreActor, spr.picnum, picnum)
DEFINE_FIELD_NAMED(DCoreActor, spr.statnum, statnum)
//DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle)
DEFINE_FIELD_NAMED(DCoreActor, spr.pos, pos)
DEFINE_FIELD_NAMED(DCoreActor, spr.xint, xvel)
DEFINE_FIELD_NAMED(DCoreActor, spr.yint, yvel)
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, zvel)
DEFINE_FIELD_NAMED(DCoreActor, spr.xint, xint)
DEFINE_FIELD_NAMED(DCoreActor, spr.yint, yint)
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, inittype)
DEFINE_FIELD_NAMED(DCoreActor, spr.hitag, hitag)
DEFINE_FIELD_NAMED(DCoreActor, spr.lotag, lotag)

View file

@ -464,8 +464,8 @@ struct spritetypebase
int16_t picnum;
int16_t statnum;
int16_t intangle; // needs to be kept for SW's SP_TAG4
union { int16_t xvel, xint; }; // alternative names are for refactoring and later use where repurposed.
union { int16_t yvel, yint; };
int16_t xint;
union { int16_t yvel, yint; }; // alternative names are for refactoring and later use where repurposed.
int16_t inittype; // was zvel. All accesses for that have been wrapped. inittype, type and flags are for Blood.
union { int16_t lotag, type; };
union { int16_t hitag, flags; };

View file

@ -464,8 +464,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, spritetype &c, spritet
("angle", c.angle, def->angle)
("ang", c.intangle, def->intangle)
("owner", c.intowner, def->intowner)
("xvel", c.xvel, def->xvel)
("yvel", c.yvel, def->yvel)
("xvel", c.xint, def->xint)
("yvel", c.yint, def->yint)
("zvel", c.inittype, def->inittype)
("lotag", c.lotag, def->lotag)
("hitag", c.hitag, def->hitag)

View file

@ -347,7 +347,7 @@ DEFINE_PROPERTY(angle, I, CoreActor)
DEFINE_PROPERTY(xvel, I, CoreActor)
{
PROP_INT_PARM(i, 0);
bag.Info->ActorInfo()->defsprite.xvel = i;
bag.Info->ActorInfo()->defsprite.xint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_XVEL;
}
@ -357,7 +357,7 @@ DEFINE_PROPERTY(xvel, I, CoreActor)
DEFINE_PROPERTY(yvel, I, CoreActor)
{
PROP_INT_PARM(i, 0);
bag.Info->ActorInfo()->defsprite.yvel = i;
bag.Info->ActorInfo()->defsprite.yint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_YVEL;
}

View file

@ -85,9 +85,9 @@ DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, sectp, sector)
DEFINE_FIELD_X(tspritetype, tspritetype, cstat)
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_NAMED_X(tspritetype, tspritetype, inittype,zvel)
DEFINE_FIELD_X(tspritetype, tspritetype, xint)
DEFINE_FIELD_X(tspritetype, tspritetype, yint)
DEFINE_FIELD_X(tspritetype, tspritetype, inittype)
DEFINE_FIELD_X(tspritetype, tspritetype, lotag)
DEFINE_FIELD_X(tspritetype, tspritetype, hitag)
DEFINE_FIELD_X(tspritetype, tspritetype, extra)

View file

@ -477,8 +477,8 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, int* cursectnum,
pSprite->statnum = LittleShort(load.statnum);
pSprite->angle = DAngle::fromBuild(LittleShort(load.ang));
pSprite->intowner = LittleShort(load.owner);
pSprite->xvel = LittleShort(load.index);
pSprite->yvel = LittleShort(load.yvel);
pSprite->xint = LittleShort(load.index);
pSprite->yint = LittleShort(load.yvel);
pSprite->inittype = LittleShort(load.inittype);
pSprite->type = LittleShort(load.type);
pSprite->flags = LittleShort(load.hitag);

View file

@ -680,9 +680,9 @@ int InitCoolgCircle(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
// set to really fast
actor->spr.xvel = 400;
actor->set_int_zvel(400);
// angle adjuster
actor->user.Counter2 = actor->spr.xvel/3;
actor->user.Counter2 = actor->int_xvel() / 3;
// random angle direction
if (RANDOM_P2(1024) < 512)
actor->user.Counter2 = -actor->user.Counter2;
@ -761,7 +761,7 @@ int DoCoolgDeath(DSWActor* actor)
DoActorSlide(actor);
// slide while falling
auto vec = actor->spr.angle.ToVector() * actor->spr.xvel * inttoworld;
auto vec = actor->spr.angle.ToVector() * actor->float_xvel();
actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(actor);

View file

@ -357,18 +357,18 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp)
ang = NORM_ANGLE(tsp->int_ang() + 1024);
if (!ownerActor->hasU() || tsp->xvel == 0)
if (!ownerActor->hasU() || ownerActor->int_xvel() == 0)
{
return;
}
if ((tsp->extra & SPRX_PLAYER_OR_ENEMY))
{
z_amt_per_pixel = IntToFixed((int)-ownerActor->user.jump_speed * ACTORMOVETICS)/tsp->xvel;
z_amt_per_pixel = IntToFixed((int)-ownerActor->user.jump_speed * ACTORMOVETICS)/tsp->ownerActor->int_xvel();
}
else
{
z_amt_per_pixel = IntToFixed((int)-ownerActor->int_zvel())/tsp->xvel;
z_amt_per_pixel = IntToFixed((int)-ownerActor->int_zvel())/tsp->ownerActor->int_xvel();
}
switch (ownerActor->user.motion_blur_dist)

View file

@ -8,9 +8,9 @@ class CoreActor native
native readonly Vector3 pos;
native readonly int16 statnum;
//native int16 ang;
native int16 xvel;
native int16 yvel;
native int16 zvel, inittype; // inittype, type and flags are for Blood.
native int16 xint;
native int16 yint;
native int16 inittype; // inittype, type and flags are for Blood.
native int16 lotag, type;
native int16 hitag, flags;
native int16 extra;

View file

@ -278,9 +278,9 @@ struct tspritetype native
native int16 statnum;
//native int16 ang;
/* these are not needed for tsprites
native int16 xvel;
native int16 yvel;
native int16 zvel;
native int16 xint;
native int16 yint;
native int16 inittype;
native int16 lotag;
native int16 hitag;
native int16 extra;