- second batch of xvel wraps.

This commit is contained in:
Christoph Oelckers 2022-09-01 16:48:02 +02:00
parent ba044ac2f4
commit 0aad018796
11 changed files with 52 additions and 52 deletions

View file

@ -628,7 +628,7 @@ void movecrane(DDukeActor *actor, int crane)
//actor->temp_data[0] = state
//actor->temp_data[1] = checking sector number
if (actor->spr.xvel) getglobalz(actor);
if(actor->float_xvel() != 0) getglobalz(actor);
if (actor->temp_data[0] == 0) //Waiting to check the sector
{
@ -651,7 +651,7 @@ void movecrane(DDukeActor *actor, int crane)
else if (actor->temp_data[0] == 1)
{
if (actor->spr.xvel < 184)
if (actor->int_xvel() < 184)
{
actor->spr.picnum = crane + 1;
actor->spr.xvel += 8;
@ -748,7 +748,7 @@ void movecrane(DDukeActor *actor, int crane)
}
else if (actor->temp_data[0] == 6)
{
if (actor->spr.xvel < 192)
if (actor->int_xvel() < 192)
actor->spr.xvel += 8;
actor->spr.angle = VecToAngle(cpt.pos.XY() - actor->spr.pos.XY());
ssp(actor, CLIPMASK0);
@ -1029,7 +1029,7 @@ void movewaterdrip(DDukeActor *actor, int drip)
{
makeitfall(actor);
ssp(actor, CLIPMASK0);
if (actor->spr.xvel > 0) actor->spr.xvel -= 2;
if(actor->float_xvel() > 0) actor->spr.xvel -= 2;
if (actor->float_zvel() == 0)
{
@ -1434,7 +1434,7 @@ bool rat(DDukeActor* actor, bool makesound)
}
else actor->set_int_ang((krand() & 2047));
}
if (actor->spr.xvel < 128)
if (actor->int_xvel() < 128)
actor->spr.xvel += 2;
actor->add_int_ang((krand() & 3) - 6);
return true;
@ -1448,7 +1448,7 @@ bool rat(DDukeActor* actor, bool makesound)
bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
{
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
DukeStatIterator it(STAT_DEFAULT);
while (auto aa = it.Next())
@ -1481,7 +1481,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
}
actor->spr.xvel--;
if (actor->spr.xvel < 0) actor->clear_xvel();
if(actor->float_xvel() < 0) actor->clear_xvel();
if (actor->spr.picnum == stripeball)
{
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
@ -1686,7 +1686,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 3)
{
actor->temp_data[3] = 0;
if (actor->spr.xvel > 0) actor->spr.xvel -= 16;
if(actor->float_xvel() > 0) actor->spr.xvel -= 16;
else actor->clear_xvel();
if (actor->temp_data[0] == 2)
@ -1730,10 +1730,10 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
else
{
// Control speed here
if (l > 1524) { if (actor->spr.xvel < 256) actor->spr.xvel += 32; }
if (l > 1524) { if (actor->int_xvel() < 256) actor->spr.xvel += 32; }
else
{
if (actor->spr.xvel > 0) actor->spr.xvel -= 16;
if(actor->float_xvel() > 0) actor->spr.xvel -= 16;
else actor->clear_xvel();
}
}
@ -2152,7 +2152,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
{
auto sectp = actor->sector();
if (actor->spr.xvel > 0) actor->spr.xvel--;
if(actor->float_xvel() > 0) actor->spr.xvel--;
else actor->clear_xvel();
if (timeout)
@ -2383,7 +2383,7 @@ void shell(DDukeActor* actor, bool morecheck)
}
if (actor->float_zvel() < 0.5) actor->add_int_zvel( (gs.gravity / 13)); // 8
else actor->add_int_zvel(- 64);
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
actor->spr.xvel -= 4;
else actor->clear_xvel();
}
@ -2397,7 +2397,7 @@ void shell(DDukeActor* actor, bool morecheck)
actor->temp_data[0] &= 3;
}
if (actor->float_zvel() < 2) actor->add_int_zvel( (gs.gravity / 3)); // 52;
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
actor->spr.xvel--;
else
{
@ -2442,7 +2442,7 @@ void glasspieces(DDukeActor* actor)
return;
}
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
{
actor->spr.xvel -= 2;
static const ESpriteFlags flips[] = { 0, CSTAT_SPRITE_XFLIP, CSTAT_SPRITE_YFLIP, CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP };
@ -2463,7 +2463,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
{
auto sectp = actor->sector();
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
actor->spr.xvel--;
else actor->clear_xvel();
@ -2769,7 +2769,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
}
Owner = actor->GetOwner();
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
int x = getangle(Owner->spr.pos.XY() - actor->spr.pos.XY());
int q = getincangle(actor->int_ang(), x) >> 3;
@ -2799,12 +2799,12 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
}
}
if (actor->spr.xvel <= 64 && statstate)
if (actor->int_xvel() <= 64 && statstate)
S_StopSound(actor->tempsound, actor);
if ((sc->floorz - sc->ceilingz) < 108)
{
if (ud.clipping == 0 && actor->spr.xvel >= 192)
if (ud.clipping == 0 && actor->int_xvel() >= 192)
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
auto psp = ps[p].GetActor();
@ -2887,7 +2887,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
if ((sc->floorz - sc->ceilingz) < 108)
{
if (ud.clipping == 0 && actor->spr.xvel >= 192)
if (ud.clipping == 0 && actor->int_xvel() >= 192)
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
if (ps[p].GetActor()->spr.extra > 0)
@ -2956,7 +2956,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
{
if (actor->spr.xvel == 0)
operateactivators(actor->spr.hitag + (!actor->temp_data[3]), -1);
if (actor->spr.xvel < 256)
if (actor->int_xvel() < 256)
actor->spr.xvel += 16;
}
}
@ -2967,7 +2967,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
if (l <= 128)
actor->clear_xvel();
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
actor->spr.xvel -= 16;
else
{
@ -2981,7 +2981,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
}
}
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
int l = MulScale(actor->int_xvel(), bcos(actor->int_ang()), 14);
int x = MulScale(actor->int_xvel(), bsin(actor->int_ang()), 14);
@ -4116,7 +4116,7 @@ void handle_se20(DDukeActor* actor)
if (actor->temp_data[0] == 1) actor->spr.xvel = 8;
else actor->spr.xvel = -8;
if (actor->spr.xvel) //Moving
if(actor->float_xvel() != 0) //Moving
{
int x = MulScale(actor->int_xvel(), bcos(actor->int_ang()), 14);
int l = MulScale(actor->int_xvel(), bsin(actor->int_ang()), 14);

View file

@ -394,7 +394,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
if (act2->spr.picnum != TANK && act2->spr.picnum != ROTATEGUN && act2->spr.picnum != RECON && !bossguy(act2))
{
if (act2->spr.xvel < 0) act2->clear_xvel();
if (act2->int_xvel() < 0) act2->clear_xvel();
act2->spr.xvel += (actor->spr.extra << 2);
}
@ -755,7 +755,7 @@ void movefallers_d(void)
}
else
{
if (act->spr.xvel > 0)
if (act->int_xvel() > 0)
{
act->spr.xvel -= 8;
ssp(act, CLIPMASK0);
@ -2226,7 +2226,7 @@ static void greenslime(DDukeActor *actor)
return;
}
else if (actor->spr.xvel < 64 && x < 768)
else if (actor->int_xvel() < 64 && x < 768)
{
if (ps[p].somethingonplayer == nullptr)
{
@ -2367,14 +2367,14 @@ static void greenslime(DDukeActor *actor)
if (everyothertime & 1) ssp(actor, CLIPMASK0);
if (actor->spr.xvel > 96)
if (actor->int_xvel() > 96)
{
actor->spr.xvel -= 2;
return;
}
else
{
if (actor->spr.xvel < 32) actor->spr.xvel += 4;
if (actor->int_xvel() < 32) actor->spr.xvel += 4;
actor->spr.xvel = 64 - bcos(actor->temp_data[1], -9);
actor->add_int_ang(getincangle(actor->int_ang(),
@ -2626,13 +2626,13 @@ static void heavyhbomb(DDukeActor *actor)
l = Owner->PlayerIndex();
else l = -1;
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
{
actor->spr.xvel -= 5;
if (sectp->lotag == 2)
actor->spr.xvel -= 10;
if (actor->spr.xvel < 0)
if(actor->float_xvel() < 0)
actor->clear_xvel();
if (actor->spr.xvel & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP;
}
@ -3560,7 +3560,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
if (actor->spr.picnum != APLAYER)
alterang(a, actor, playernum);
if (actor->spr.xvel > -6 && actor->spr.xvel < 6) actor->clear_xvel();
if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->clear_xvel();
a = badguy(actor);

View file

@ -330,7 +330,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
(pic != HULK && pic != MAMA && pic != BILLYPLAY && pic != COOTPLAY && pic != MAMACLOUD) :
(pic != HULK && pic != SBMOVE))
{
if (act2->spr.xvel < 0) act2->clear_xvel();
if (act2->int_xvel() < 0) act2->clear_xvel();
act2->spr.xvel += (act2->spr.extra << 2);
}
@ -672,7 +672,7 @@ void movefallers_r(void)
}
else
{
if (act->spr.xvel > 0)
if (act->int_xvel() > 0)
{
act->spr.xvel -= 2;
ssp(act, CLIPMASK0);
@ -2414,13 +2414,13 @@ static void heavyhbomb(DDukeActor *actor)
l = Owner->PlayerIndex();
else l = -1;
if (actor->spr.xvel > 0)
if(actor->float_xvel() > 0)
{
actor->spr.xvel -= 5;
if (sectp->lotag == 2)
actor->spr.xvel -= 10;
if (actor->spr.xvel < 0)
if(actor->float_xvel() < 0)
actor->clear_xvel();
if (actor->spr.xvel & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP;
}
@ -2558,7 +2558,7 @@ static int henstand(DDukeActor *actor)
}
if (actor->sector()->lotag == 900)
actor->clear_xvel();
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
makeitfall(actor);
Collision coll;
@ -2591,7 +2591,7 @@ static int henstand(DDukeActor *actor)
}
}
actor->spr.xvel--;
if (actor->spr.xvel < 0) actor->clear_xvel();
if(actor->float_xvel() < 0) actor->clear_xvel();
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
if (actor->spr.picnum == BOWLINGPIN)
{
@ -3629,7 +3629,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
if (actor->spr.picnum != APLAYER)
alterang(a, actor, pnum);
if (actor->spr.xvel > -6 && actor->spr.xvel < 6) actor->clear_xvel();
if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->clear_xvel();
a = badguy(actor);

View file

@ -489,7 +489,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
{
auto& pp = ps[p];
auto act = pp.GetActor();
int i = TILE_APLAYERTOP + (act->spr.xvel > 16 && pp.on_ground ? (PlayClock >> 4) & 3 : 0);
int i = TILE_APLAYERTOP + (act->int_xvel() > 16 && pp.on_ground ? (PlayClock >> 4) & 3 : 0);
double j = clamp(czoom * act->spr.yrepeat + abs(pp.truefz - pp.pos.Z), 21.5, 128.) * REPEAT_SCALE;
auto const vec = OutAutomapVector(mxy - cpos, cangsin, cangcos, czoom, xydim);

View file

@ -3048,7 +3048,7 @@ HORIZONLY:
if (p->jetpack_on == 0)
{
if (pact->spr.xvel > 16)
if (pact->int_xvel() > 16)
{
if (psectlotag != 1 && psectlotag != 2 && p->on_ground)
{

View file

@ -3883,7 +3883,7 @@ HORIZONLY:
if (p->jetpack_on == 0)
{
if (pact->spr.xvel > 16)
if (pact->int_xvel() > 16)
{
if (psectlotag != ST_1_ABOVE_WATER && psectlotag != ST_2_UNDERWATER && p->on_ground && (!isRRRA() || !p->sea_sick_stat))
{

View file

@ -224,17 +224,17 @@ void AIMummy::Tick(RunListEvent* ev)
if (pActor->spr.xvel || pActor->spr.yvel)
{
if (pActor->spr.xvel > 0)
if (pActor->int_xvel() > 0)
{
pActor->spr.xvel -= 1024;
if (pActor->spr.xvel < 0) {
if (pActor->int_xvel() < 0) {
pActor->clear_xvel();
}
}
else if (pActor->spr.xvel < 0)
else if (pActor->int_xvel() < 0)
{
pActor->spr.xvel += 1024;
if (pActor->spr.xvel > 0) {
if (pActor->int_xvel() > 0) {
pActor->clear_xvel();
}
}

View file

@ -1592,7 +1592,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos,
{
if (Player[p].actor == actor)
{
if (actor->spr.xvel > 16)
if (actor->int_xvel() > 16)
pspr_ndx[myconnectindex] = ((PlayClock >> 4) & 3);
sprisplayer = true;

View file

@ -349,7 +349,7 @@ int DoBloodSpray(DSWActor* actor)
actor->user.addCounterToChange();
}
if (actor->spr.xvel <= 2)
if (actor->int_xvel() <= 2)
{
// special stuff for blood worm
actor->spr.pos.Z += actor->user.change.Z * 0.5;

View file

@ -341,7 +341,7 @@ int DoSkullBeginDeath(DSWActor* actor)
int DoSkullJump(DSWActor* actor)
{
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
DoSkullMove(actor);
else
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + (64 * ACTORMOVETICS)));
@ -355,7 +355,7 @@ int DoSkullJump(DSWActor* actor)
DoFall(actor);
// jump/fall type
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
int dist,a,b,c;
@ -710,7 +710,7 @@ int DoBettyBeginDeath(DSWActor* actor)
int DoBettyJump(DSWActor* actor)
{
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
DoBettyMove(actor);
else
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + (64 * ACTORMOVETICS)));
@ -724,7 +724,7 @@ int DoBettyJump(DSWActor* actor)
DoFall(actor);
// jump/fall type
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
int dist,a,b,c;

View file

@ -4982,7 +4982,7 @@ int DoGet(DSWActor* actor)
return 0;
}
if (actor->spr.xvel)
if(actor->float_xvel() != 0)
{
if (!DoItemFly(actor))
{