diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 44cfc5a5d..f187b4050 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -473,6 +473,12 @@ struct spritetypebase { pos = { x * maptoworld, y * maptoworld, z * zmaptoworld }; } + + void SetScale(double x, double y) + { + xrepeat = uint8_t(x * (1 / REPEAT_SCALE)); + yrepeat = uint8_t(y * (1 / REPEAT_SCALE)); + } }; diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 30e0d0478..6f97cf85c 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -2304,7 +2304,8 @@ bool genDudePrepare(DBloodActor* actor, int propId) case kGenDudePropertyMass: { // to ensure mass gets updated, let's clear all cache SPRITEMASS* pMass = &actor->spriteMass; - pMass->seqId = pMass->picnum = pMass->xrepeat = pMass->yrepeat = 0; + pMass->seqId = pMass->picnum = 0; + pMass->xrepeat = pMass->yrepeat = 0; pMass->clipDist = 0; pMass->mass = pMass->airVel = pMass->fraction = 0; getSpriteMassBySize(actor); diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index d257ec567..54b40bb64 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -719,7 +719,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, } else { - pTSprite->xrepeat = pTSprite->yrepeat = 0; + pTSprite->SetScale(0, 0); } } if (owneractor->hasX() && owneractor->xspr.burnTime > 0) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 48b83a31f..9cb917b68 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -254,7 +254,7 @@ void insertspriteq(DDukeActor* const actor) spriteq[spriteqloc] = actor; spriteqloc = (spriteqloc + 1) % spriteqamount; } - else actor->spr.xrepeat = actor->spr.yrepeat = 0; + else actor->spr.SetScale(0, 0); } //--------------------------------------------------------------------------- @@ -4352,7 +4352,7 @@ void handle_se24(DDukeActor *actor, bool scroll, double mult) case STAT_DEFAULT: if (actorflag(a2, SFLAG_SE24_REMOVE)) { - a2->spr.xrepeat = a2->spr.yrepeat = 0; + a2->spr.SetScale(0, 0); continue; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 872e2632d..950760a72 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -840,7 +840,7 @@ static void movetripbomb(DDukeActor *actor) while (auto a1 = it.Next()) { if (a1->spr.picnum == LASERLINE && actor->spr.hitag == a1->spr.hitag) - a1->spr.xrepeat = a1->spr.yrepeat = 0; + a1->spr.SetScale(0, 0); } deletesprite(actor); } @@ -1092,7 +1092,7 @@ CLEAR_THE_BOLT2: actor->temp_data[0] = actor->spr.xrepeat; actor->temp_data[1] = actor->spr.yrepeat; actor->temp_data[2] = global_random & 4; - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); goto CLEAR_THE_BOLT2; } actor->spr.picnum++; @@ -1138,7 +1138,7 @@ CLEAR_THE_BOLT: actor->temp_data[0] = actor->spr.xrepeat; actor->temp_data[1] = actor->spr.yrepeat; actor->temp_data[2] = global_random & 4; - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); goto CLEAR_THE_BOLT; } actor->spr.picnum++; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index bab54957c..1e2e036db 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -777,7 +777,7 @@ CLEAR_THE_BOLT: actor->temp_data[0] = actor->spr.xrepeat; actor->temp_data[1] = actor->spr.yrepeat; actor->temp_data[2] = global_random & 4; - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); goto CLEAR_THE_BOLT; } actor->spr.picnum++; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 7d672b59a..d5fe65e8f 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -63,7 +63,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case DEVELOPERCOMMENTARY: case DEVELOPERCOMMENTARY + 1: if (isWorldTour() && !wt_commentary) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); break; case BLOODPOOL: case PUKE: @@ -77,7 +77,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi case RESPAWNMARKERYELLOW: case RESPAWNMARKERGREEN: if (ud.marker == 0) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); continue; case CHAIR3: if (hw_models && modelManager.CheckModel(t->picnum, t->pal)) @@ -154,7 +154,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->cstat |= CSTAT_SPRITE_YCENTER; } else - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); break; case NATURALLIGHTNING: t->shade = -127; @@ -211,7 +211,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi double dist1 = (OwnerAc->spr.pos.XY() - t->pos.XY()).LengthSquared(); double dist2 = (OwnerAc->spr.pos.XY() - ps[screenpeek].GetActor()->spr.pos.XY()).LengthSquared(); if (dist1 < dist2) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); } } continue; @@ -409,7 +409,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) { t->ownerActor = nullptr; - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); continue; } @@ -730,7 +730,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi h->dispicnum = t->picnum; if (t->sectp->floorpicnum == MIRROR) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); } } diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index f4e8aff7a..b45d5ffb0 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -138,7 +138,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi t->cstat |= CSTAT_SPRITE_YCENTER; } else - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); break; default: break; @@ -175,7 +175,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi else t->pal = 2; if (ud.marker == 0) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); break; case DUKELYINGDEAD: h->spr.xrepeat = 24; @@ -206,7 +206,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi double dist1 = (OwnerAc->spr.pos.XY() - t->pos.XY()).LengthSquared(); double dist2 = (OwnerAc->spr.pos.XY() - ps[screenpeek].GetActor()->spr.pos.XY()).LengthSquared(); if (dist1 < dist2) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); } } continue; @@ -453,7 +453,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) { t->ownerActor = nullptr; - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); continue; } @@ -695,7 +695,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi if (t->picnum < 0 || t->picnum >= MAXTILES) { t->picnum = 0; - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); } if (h->dispicnum >= 0) @@ -958,7 +958,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi h->dispicnum = t->picnum; if (t->sectp->floorpicnum == MIRROR) - t->xrepeat = t->yrepeat = 0; + t->SetScale(0, 0); } } END_DUKE_NS diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 374e59a1e..60aa69239 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -445,7 +445,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int fi.checkhitsprite(hit.actor(), spark); if (hit.actor()->isPlayer() && (ud.coop != 1 || ud.ffire == 1)) { - spark->spr.xrepeat = spark->spr.yrepeat = 0; + spark->spr.SetScale(0, 0); auto jib = spawn(spark, JIBS6); if (jib) { @@ -549,7 +549,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int fi.checkhitsprite(hit.actor(), spark); if (!hit.actor()->isPlayer()) spawn(spark, SMALLSMOKE); - else spark->spr.xrepeat = spark->spr.yrepeat = 0; + else spark->spr.SetScale(0, 0); } else if (hit.hitWall) fi.checkhitwall(spark, hit.hitWall, hit.hitpos, SHOTSPARK1); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 9d28aed96..cc60cdba0 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -331,7 +331,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int if (hit.actor()->isPlayer() && (ud.coop != 1 || ud.ffire == 1)) { auto jib = spawn(spark, JIBS6); - spark->spr.xrepeat = spark->spr.yrepeat = 0; + spark->spr.SetScale(0, 0); if (jib) { jib->spr.pos.Z += 4; @@ -437,7 +437,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int fi.checkhitsprite(hit.actor(), spark); if (!hit.actor()->isPlayer()) spawn(spark, SMALLSMOKE); - else spark->spr.xrepeat = spark->spr.yrepeat = 0; + else spark->spr.SetScale(0, 0); } else if (hit.hitWall != nullptr) fi.checkhitwall(spark, hit.hitWall, hit.hitpos, SHOTSPARK1); diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index bf4df91e7..a8aae2c69 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -151,7 +151,7 @@ bool initspriteforspawn(DDukeActor* act) { if ((ud.multimode < 2) || (ud.multimode > 1 && ud.coop == 1)) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); act->spr.cstat = 0; act->spr.lotag = act->spr.hitag = 0; return false; @@ -226,7 +226,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act) if (actj == nullptr && act->spr.lotag > ud.player_skill) { // make it go away... - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); return; } @@ -239,7 +239,7 @@ void spawninitdefault(DDukeActor* actj, DDukeActor *act) { if (ud.monsters_off == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); return; } @@ -328,7 +328,9 @@ int spawnbloodpoolpart1(DDukeActor* act) if (!away) { - act->spr.xrepeat = act->spr.yrepeat = 0; ChangeActorStat(act, STAT_MISC); return true; + act->spr.SetScale(0, 0); + ChangeActorStat(act, STAT_MISC); + return true; } if (act->sector()->lotag == 1) @@ -353,7 +355,7 @@ void initfootprint(DDukeActor* actj, DDukeActor* act) bool away = isAwayFromWall(act, 5.25); if (!away) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); return; } @@ -511,7 +513,7 @@ int initreactor(DDukeActor* actj, DDukeActor* actor, bool isrecon) { if (actor->spr.lotag > ud.player_skill) { - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); ChangeActorStat(actor, STAT_MISC); return true; } @@ -520,7 +522,7 @@ int initreactor(DDukeActor* actj, DDukeActor* actor, bool isrecon) actor->temp_data[5] = 0; if (ud.monsters_off == 1) { - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); ChangeActorStat(actor, STAT_MISC); return false; } @@ -533,7 +535,7 @@ int initreactor(DDukeActor* actj, DDukeActor* actor, bool isrecon) if (ud.multimode < 2 && actor->spr.pal != 0) { - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); ChangeActorStat(actor, STAT_MISC); return false; } @@ -557,7 +559,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) actor->spr.yint = sectp->extra; actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); switch (actor->spr.lotag) { diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 98f793e4a..761376dc9 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -85,7 +85,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if ((act->spr.lotag > ud.player_skill) || ud.monsters_off) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -142,7 +142,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* spawninitdefault(actj, act); break; case FOF: - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; case WATERSPLASH2: @@ -225,7 +225,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->spr.yrepeat = actj->spr.yrepeat; act->temp_data[1] = actj->spr.picnum; } - else act->spr.xrepeat = act->spr.yrepeat = 0; + else act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); @@ -323,7 +323,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case TRIPBOMB: if (act->spr.lotag > ud.player_skill) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -432,7 +432,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case SIGN2: if (ud.multimode < 2 && act->spr.pal) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); } else act->spr.pal = 0; @@ -580,7 +580,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case MUSICANDSFX: if (ud.multimode < 2 && act->spr.pal == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -665,7 +665,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case APLAYER: { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); int j = ud.coop; if (j == 2) j = 0; @@ -723,7 +723,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* { if (act->spr.pal && ud.multimode > 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -733,7 +733,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* || (act->spr.pal == 2 && (ud.multimode == 1 || (ud.multimode > 1 && ud.coop != 1))) // Co-op Only || (act->spr.pal == 3 && (ud.multimode == 1 || (ud.multimode > 1 && ud.coop == 1)))) // Dukematch Only { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -864,7 +864,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if ((act->spr.lotag > ud.player_skill) || ud.monsters_off == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1011,7 +1011,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if ((ud.multimode < 2 && act->spr.pal != 0) || (act->spr.lotag > ud.player_skill)) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1026,7 +1026,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (ud.multimode > 1 && ud.coop != 1 && act->spr.picnum == ACCESSCARD) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1091,7 +1091,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (ud.multimode < 2 && act->spr.pal != 0) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1127,7 +1127,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.xrepeat <= 8) { act->spr.cstat = CSTAT_SPRITE_INVISIBLE; - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); } else act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.extra = gs.impact_damage << 2; @@ -1153,7 +1153,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (ud.multimode < 2 && act->spr.pal != 0) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1199,7 +1199,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case EGG: if (ud.monsters_off == 1 && act->spr.picnum == EGG) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); } else diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 89a71700c..479723562 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -304,7 +304,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* else act->temp_data[1] = actj->spr.picnum; } - else act->spr.xrepeat = act->spr.yrepeat = 0; + else act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; @@ -596,7 +596,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case MUSICANDSFX: if (ud.multimode < 2 && act->spr.pal == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -670,7 +670,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case APLAYER: { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); int j = ud.coop; if (j == 2) j = 0; @@ -718,7 +718,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* sectp->setfloorz(act->spr.pos.Z); if (act->spr.pal && ud.multimode > 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1024,7 +1024,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if ((act->spr.lotag > ud.player_skill) || ud.monsters_off == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1173,7 +1173,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if ((ud.multimode < 2 && act->spr.pal != 0) || (act->spr.lotag > ud.player_skill)) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1188,7 +1188,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (ud.multimode > 1 && ud.coop != 1 && act->spr.picnum == ACCESSCARD) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1343,7 +1343,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (ud.multimode < 2 && act->spr.pal != 0) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1376,7 +1376,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (act->spr.xrepeat <= 8) { act->spr.cstat = CSTAT_SPRITE_INVISIBLE; - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); } else act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; act->spr.extra = gs.impact_damage << 2; @@ -1392,7 +1392,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.extra = 1; if (ud.multimode < 2 && act->spr.pal != 0) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); break; } @@ -1408,7 +1408,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (!isRRRA()) goto default_case; if (ud.multimode < 2 && act->spr.pal == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); break; } act->spr.pal = 0; @@ -1424,7 +1424,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* if (!isRRRA()) goto default_case; if (ud.multimode < 2 && act->spr.pal == 1) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); break; } act->spr.pal = 0; @@ -1470,7 +1470,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case EGG: if (ud.monsters_off == 1 && act->spr.picnum == EGG) { - act->spr.xrepeat = act->spr.yrepeat = 0; + act->spr.SetScale(0, 0); ChangeActorStat(act, STAT_MISC); } else diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index e57a4114c..814480eac 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2640,7 +2640,7 @@ void SpriteSetup(void) SpawnUser(actor, ST1, nullptr); if (actor->spr.xrepeat == 64 && actor->spr.yrepeat == 64) // clear default xrepeat. - actor->spr.xrepeat = actor->spr.yrepeat = 0; + actor->spr.SetScale(0, 0); change_actor_stat(actor, STAT_SPAWN_SPOT); break; diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 3d748a74d..7404f58fa 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -4134,7 +4134,7 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, DAngle hit_angle, const DVe // Don't do central blood splats for every hitscan if (RANDOM_P2(1024) < 950) { - actorNew->spr.xrepeat = actorNew->spr.yrepeat = 0; + actorNew->spr.SetScale(0, 0); } if (RANDOM_P2(1024) < 512) actorNew->spr.cstat |= (CSTAT_SPRITE_XFLIP);