- 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.statnum, statnum)
//DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle) //DEFINE_FIELD_NAMED(DCoreActor, spr.angle, angle)
DEFINE_FIELD_NAMED(DCoreActor, spr.pos, pos) DEFINE_FIELD_NAMED(DCoreActor, spr.pos, pos)
DEFINE_FIELD_NAMED(DCoreActor, spr.xint, xvel) DEFINE_FIELD_NAMED(DCoreActor, spr.xint, xint)
DEFINE_FIELD_NAMED(DCoreActor, spr.yint, yvel) DEFINE_FIELD_NAMED(DCoreActor, spr.yint, yint)
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, zvel)
DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, inittype) DEFINE_FIELD_NAMED(DCoreActor, spr.inittype, inittype)
DEFINE_FIELD_NAMED(DCoreActor, spr.hitag, hitag) DEFINE_FIELD_NAMED(DCoreActor, spr.hitag, hitag)
DEFINE_FIELD_NAMED(DCoreActor, spr.lotag, lotag) DEFINE_FIELD_NAMED(DCoreActor, spr.lotag, lotag)

View file

@ -464,8 +464,8 @@ struct spritetypebase
int16_t picnum; int16_t picnum;
int16_t statnum; int16_t statnum;
int16_t intangle; // needs to be kept for SW's SP_TAG4 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. int16_t xint;
union { int16_t yvel, yint; }; 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. 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 lotag, type; };
union { int16_t hitag, flags; }; 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) ("angle", c.angle, def->angle)
("ang", c.intangle, def->intangle) ("ang", c.intangle, def->intangle)
("owner", c.intowner, def->intowner) ("owner", c.intowner, def->intowner)
("xvel", c.xvel, def->xvel) ("xvel", c.xint, def->xint)
("yvel", c.yvel, def->yvel) ("yvel", c.yint, def->yint)
("zvel", c.inittype, def->inittype) ("zvel", c.inittype, def->inittype)
("lotag", c.lotag, def->lotag) ("lotag", c.lotag, def->lotag)
("hitag", c.hitag, def->hitag) ("hitag", c.hitag, def->hitag)

View file

@ -347,7 +347,7 @@ DEFINE_PROPERTY(angle, I, CoreActor)
DEFINE_PROPERTY(xvel, I, CoreActor) DEFINE_PROPERTY(xvel, I, CoreActor)
{ {
PROP_INT_PARM(i, 0); PROP_INT_PARM(i, 0);
bag.Info->ActorInfo()->defsprite.xvel = i; bag.Info->ActorInfo()->defsprite.xint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_XVEL; bag.Info->ActorInfo()->DefaultFlags |= DEFF_XVEL;
} }
@ -357,7 +357,7 @@ DEFINE_PROPERTY(xvel, I, CoreActor)
DEFINE_PROPERTY(yvel, I, CoreActor) DEFINE_PROPERTY(yvel, I, CoreActor)
{ {
PROP_INT_PARM(i, 0); PROP_INT_PARM(i, 0);
bag.Info->ActorInfo()->defsprite.yvel = i; bag.Info->ActorInfo()->defsprite.yint = i;
bag.Info->ActorInfo()->DefaultFlags |= DEFF_YVEL; 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, cstat)
DEFINE_FIELD_X(tspritetype, tspritetype, statnum) DEFINE_FIELD_X(tspritetype, tspritetype, statnum)
DEFINE_FIELD_X(tspritetype, tspritetype, angle) DEFINE_FIELD_X(tspritetype, tspritetype, angle)
DEFINE_FIELD_X(tspritetype, tspritetype, xvel) DEFINE_FIELD_X(tspritetype, tspritetype, xint)
DEFINE_FIELD_X(tspritetype, tspritetype, yvel) DEFINE_FIELD_X(tspritetype, tspritetype, yint)
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, inittype,zvel) DEFINE_FIELD_X(tspritetype, tspritetype, inittype)
DEFINE_FIELD_X(tspritetype, tspritetype, lotag) DEFINE_FIELD_X(tspritetype, tspritetype, lotag)
DEFINE_FIELD_X(tspritetype, tspritetype, hitag) DEFINE_FIELD_X(tspritetype, tspritetype, hitag)
DEFINE_FIELD_X(tspritetype, tspritetype, extra) 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->statnum = LittleShort(load.statnum);
pSprite->angle = DAngle::fromBuild(LittleShort(load.ang)); pSprite->angle = DAngle::fromBuild(LittleShort(load.ang));
pSprite->intowner = LittleShort(load.owner); pSprite->intowner = LittleShort(load.owner);
pSprite->xvel = LittleShort(load.index); pSprite->xint = LittleShort(load.index);
pSprite->yvel = LittleShort(load.yvel); pSprite->yint = LittleShort(load.yvel);
pSprite->inittype = LittleShort(load.inittype); pSprite->inittype = LittleShort(load.inittype);
pSprite->type = LittleShort(load.type); pSprite->type = LittleShort(load.type);
pSprite->flags = LittleShort(load.hitag); pSprite->flags = LittleShort(load.hitag);

View file

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

View file

@ -357,18 +357,18 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp)
ang = NORM_ANGLE(tsp->int_ang() + 1024); ang = NORM_ANGLE(tsp->int_ang() + 1024);
if (!ownerActor->hasU() || tsp->xvel == 0) if (!ownerActor->hasU() || ownerActor->int_xvel() == 0)
{ {
return; return;
} }
if ((tsp->extra & SPRX_PLAYER_OR_ENEMY)) 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 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) switch (ownerActor->user.motion_blur_dist)

View file

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

View file

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