diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 3dfaba461..03f22c77c 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -421,7 +421,7 @@ void moveplayers(void) auto psp = ps[otherp].GetActor(); if (psp->spr.extra > 0) { - if (act->spr.yrepeat > 32 && psp->spr.yrepeat < 32) + if (act->spr.yrepeat > 32 && psp->spr.ScaleY() < 0.5) { if (other < 1400/16. && p->knee_incs == 0) { @@ -2289,7 +2289,7 @@ bool bloodpool(DDukeActor* actor, bool puke) actor->temp_data[2]++; if (attackerflag(actor, SFLAG_FLAMMABLEPOOLEFFECT)) { - if (actor->spr.xrepeat < 64 && actor->spr.yrepeat < 64) + if (actor->spr.ScaleX() < 1 && actor->spr.ScaleY() < 1) { actor->spr.xrepeat += krand() & 3; actor->spr.yrepeat += krand() & 3; @@ -2297,7 +2297,7 @@ bool bloodpool(DDukeActor* actor, bool puke) } else { - if (actor->spr.xrepeat < 32 && actor->spr.yrepeat < 32) + if (actor->spr.ScaleX() < 0.5 && actor->spr.ScaleY() < 0.5) { actor->spr.xrepeat += krand() & 3; actor->spr.yrepeat += krand() & 3; @@ -2509,7 +2509,7 @@ void gutsdir(DDukeActor* actor, int gtype, int n, int p) { int sx, sy; - if (badguy(actor) && actor->spr.xrepeat < 16) + if (badguy(actor) && actor->spr.ScaleX() < 0.25) sx = sy = 8; else sx = sy = 32; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index f6cda9433..9c494228b 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -439,7 +439,7 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip { int bg = badguy(actor); - if (actor->spr.statnum == STAT_MISC || (bg && actor->spr.xrepeat < 4)) + if (actor->spr.statnum == STAT_MISC || (bg && actor->spr.ScaleX() < 0.0625)) { actor->spr.pos += change; if (bg) @@ -540,7 +540,7 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p) int sx, sy; uint8_t pal; - if (badguy(actor) && actor->spr.xrepeat < 16) + if (badguy(actor) && actor->spr.ScaleX() < 0.25) sx = sy = 8; else sx = sy = 32; @@ -2300,10 +2300,10 @@ static void greenslime(DDukeActor *actor) actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5; actor->spr.picnum = GREENSLIME + 2 + (global_random & 1); - if (actor->spr.yrepeat < 64) actor->spr.yrepeat += 2; + if (actor->spr.ScaleY() < 1) actor->spr.yrepeat += 2; else { - if (actor->spr.xrepeat < 32) actor->spr.xrepeat += 4; + if (actor->spr.ScaleX() < 0.5) actor->spr.xrepeat += 4; else { actor->temp_data[0] = -1; @@ -2458,7 +2458,7 @@ static void flamethrowerflame(DDukeActor *actor) getglobalz(actor); int ds = actor->temp_data[0] / 6; - if (actor->spr.xrepeat < 80) + if (actor->spr.ScaleX() < 0.1250) actor->spr.yrepeat = actor->spr.xrepeat += ds; actor->clipdist += ds * 0.25; if (actor->temp_data[0] <= 2) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 380863c1a..b18a92add 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -367,7 +367,7 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip { int bg = badguy(actor); - if (actor->spr.statnum == 5 || (bg && actor->spr.xrepeat < 4)) + if (actor->spr.statnum == 5 || (bg && actor->spr.ScaleX() < 0.0625)) { actor->spr.pos += change; if (bg) @@ -446,7 +446,7 @@ void guts_r(DDukeActor* actor, int gtype, int n, int p) int sx, sy; uint8_t pal; - if (badguy(actor) && actor->spr.xrepeat < 16) + if (badguy(actor) && actor->spr.ScaleX() < 0.25) sx = sy = 4; else sx = sy = 16; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 61f61206a..99410938e 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -323,7 +323,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi newtspr->statnum = 99; newtspr->yrepeat = (t->yrepeat >> 3); - if (t->yrepeat < 4) t->yrepeat = 4; + if (t->ScaleY() < 0.0625) t->yrepeat = 4; newtspr->shade = t->shade; newtspr->cstat = 0; @@ -418,7 +418,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (!h->GetOwner()) continue; - if (t->pos.Z > h->floorz && t->xrepeat < 32) + if (t->pos.Z > h->floorz && t->ScaleX() < 0.5) t->pos.Z = h->floorz; break; @@ -574,7 +574,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi shadowspr->statnum = 99; shadowspr->yrepeat = (t->yrepeat >> 3); - if (t->yrepeat < 4) t->yrepeat = 4; + if (t->ScaleY() < 0.0625) t->yrepeat = 4; shadowspr->shade = 127; shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 66a7ae41a..625c0eb22 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -363,7 +363,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi newtspr->statnum = 99; newtspr->yrepeat = (t->yrepeat >> 3); - if (t->yrepeat < 4) t->yrepeat = 4; + if (t->ScaleY() < 0.0625) t->yrepeat = 4; newtspr->shade = t->shade; newtspr->cstat = 0; @@ -459,7 +459,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (!h->GetOwner()) continue; - if (t->pos.Z > h->floorz && t->xrepeat < 32) + if (t->pos.Z > h->floorz && t->ScaleX() < 0.5) t->pos.Z = h->floorz; if (ps[p].OnMotorcycle && p == screenpeek) @@ -723,7 +723,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi shadowspr->statnum = 99; shadowspr->yrepeat = (t->yrepeat >> 3); - if (t->yrepeat < 4) t->yrepeat = 4; + if (t->ScaleY() < 0.0625) t->yrepeat = 4; shadowspr->shade = 127; shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 1f344bb1f..7b2dabfa0 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -236,7 +236,7 @@ void displayweapon_d(int snum, double interpfrac) looking_arc = p->angle.looking_arc(interpfrac); hard_landing *= 8.; - gun_pos -= fabs(p->GetActor()->spr.xrepeat < 32 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16); + gun_pos -= fabs(p->GetActor()->spr.ScaleX() < 0.5 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16); gun_pos -= hard_landing; weapon_xoffset = (160)-90; diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index 242533d58..a0dd51f02 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -137,7 +137,7 @@ void displayweapon_r(int snum, double interpfrac) looking_arc = p->angle.looking_arc(interpfrac); hard_landing *= 8.; - gun_pos -= fabs(p->GetActor()->spr.xrepeat < 8 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16); + gun_pos -= fabs(p->GetActor()->spr.ScaleX() < 0.125 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16); gun_pos -= hard_landing; weapon_xoffset = (160)-90; @@ -289,7 +289,7 @@ void displayweapon_r(int snum, double interpfrac) return; } - if (p->GetActor()->spr.xrepeat < 8) + if (p->GetActor()->spr.ScaleX() < 0.125) { animateshrunken(p, weapon_xoffset, looking_arc, look_anghalf, FIST, shade, o, interpfrac); } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index b57c52117..01d25d18c 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2562,7 +2562,7 @@ static void operateweapon(int snum, ESyncBits actions) fi.shoot(pact, FREEZEBLAST); checkavailweapon(p); } - if (pact->spr.xrepeat < 32) + if (pact->spr.ScaleX() < 0.5) { p->okickback_pic = p->kickback_pic = 0; break; } @@ -2660,7 +2660,7 @@ static void processweapon(int snum, ESyncBits actions) { auto p = &ps[snum]; auto pact = p->GetActor(); - int shrunk = (pact->spr.yrepeat < 32); + int shrunk = (pact->spr.ScaleY() < 0.5); if (isNamWW2GI() && (actions & SB_HOLSTER)) // 'Holster Weapon { @@ -2770,7 +2770,7 @@ void processinput_d(int snum) psectlotag = psectp->lotag; p->spritebridge = 0; - shrunk = (pact->spr.yrepeat < 32); + shrunk = (pact->spr.ScaleY() < 0.5); getzrange(p->pos, psectp, &ceilingz, chz, &floorz, clz, 10.1875, CLIPMASK0); p->truefz = getflorzofslopeptr(psectp, p->pos); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index c69f258e2..9f9397db5 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3274,7 +3274,7 @@ static void processweapon(int snum, ESyncBits actions, sectortype* psectp) { auto p = &ps[snum]; auto pact = p->GetActor(); - int shrunk = (pact->spr.yrepeat < 8); + int shrunk = (pact->spr.ScaleY() < 0.125); if (p->detonate_count > 0) { @@ -3388,7 +3388,7 @@ void processinput_r(int snum) p->spritebridge = 0; - shrunk = (pact->spr.yrepeat < 8); + shrunk = (pact->spr.ScaleY() < 0.125); double tempfz; if (pact->clipdist == 16) { @@ -3533,7 +3533,7 @@ void processinput_r(int snum) return; } - if (p->GetActor()->spr.xrepeat < 8 && p->jetpack_on == 0) + if (p->GetActor()->spr.ScaleX() < 0.125 && p->jetpack_on == 0) { p->ofistsign = p->fistsign; p->fistsign += p->GetActor()->vel.X * 16; diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index acb2c4209..d93c24898 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -146,7 +146,7 @@ void AISoul::Tick(RunListEvent* ev) seq_MoveSequence(pActor, SeqOffsets[kSeqSet] + 75, 0); - if (pActor->spr.xrepeat < 32) + if (pActor->spr.ScaleX() < 0.5) { pActor->spr.xrepeat++; pActor->spr.yrepeat++; diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index f3aa74eeb..e47cb1972 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -873,7 +873,7 @@ int DoCoolgMove(DSWActor* actor) { actor->spr.xrepeat--; actor->spr.shade++; - if (actor->spr.xrepeat < 4) actor->spr.xrepeat = 4; + if (actor->spr.ScaleX() < 0.0625) actor->spr.xrepeat = 4; if (actor->spr.shade > 126) { actor->spr.shade = 127; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index d6f2fe1bc..4573a2baa 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -10919,7 +10919,7 @@ void SpawnMeteorExp(DSWActor* actor) expActor->spr.hitag = LUMINOUS; //Always full brightness expActor->spr.shade = -40; - if (actor->spr.yrepeat < 64) + if (actor->spr.ScaleY() < 1) { // small expActor->spr.SetScale(1, 1); @@ -18364,7 +18364,7 @@ int DoFloorBlood(DSWActor* actor) int DoWallBlood(DSWActor* actor) { // Make blood drip down the wall - if (actor->spr.yrepeat < 80) + if (actor->spr.ScaleY() < 1.25) { actor->spr.yrepeat++; actor->spr.pos.Z += 0.5;