From 639613297d7485525bf43e1989332056ad00b101 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 24 Dec 2021 16:47:29 +0100 Subject: [PATCH] - globally replaced sp-> in several files. No further cleanup yet. --- source/games/sw/src/sumo.cpp | 20 ++++++++++---------- source/games/sw/src/zilla.cpp | 34 +++++++++++++++++----------------- source/games/sw/src/zombie.cpp | 18 +++++++++--------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/source/games/sw/src/sumo.cpp b/source/games/sw/src/sumo.cpp index 09d28568a..b8735cc3f 100644 --- a/source/games/sw/src/sumo.cpp +++ b/source/games/sw/src/sumo.cpp @@ -638,7 +638,7 @@ int SetupSumo(DSWActor* actor) USERp u; ANIMATOR DoActorDecide; - if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE)) + if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE)) { u = actor->u(); ASSERT(u); @@ -660,19 +660,19 @@ int SetupSumo(DSWActor* actor) EnemyDefaults(actor, &SumoActionSet, &SumoPersonality); - sp->clipdist = (512) >> 2; - if (sp->pal == 16) + actor->spr.clipdist = (512) >> 2; + if (actor->spr.pal == 16) { // Mini Sumo - sp->xrepeat = 43; - sp->yrepeat = 29; + actor->spr.xrepeat = 43; + actor->spr.yrepeat = 29; u->ActorActionSet = &MiniSumoActionSet; u->Health = 500; } else { - sp->xrepeat = 115; - sp->yrepeat = 75; + actor->spr.xrepeat = 115; + actor->spr.yrepeat = 75; } //SET(u->Flags, SPR_XFLIP_TOGGLE); @@ -754,7 +754,7 @@ int InitSumoClap(DSWActor* actor) USER* u = actor->u(); SPRITEp sp = &actor->s(); - if (sp->pal == 16 && RandomRange(1000) <= 800) + if (actor->spr.pal == 16 && RandomRange(1000) <= 800) InitMiniSumoClap(actor); else InitSumoSkull(actor); @@ -772,7 +772,7 @@ int DoSumoDeathMelt(DSWActor* actor) InitChemBomb(actor); u->ID = 0; - DoMatchEverything(nullptr, sp->lotag, ON); + DoMatchEverything(nullptr, actor->spr.lotag, ON); if (!SW_SHAREWARE) { // Resume the regular music - in a hack-free fashion. @@ -838,7 +838,7 @@ void BossHealthMeter(void) sp = &actor->s(); u = actor->u(); - if (cansee(sp->pos.X, sp->pos.Y, GetSpriteZOfTop(sp), sp->sector(), pp->pos.X, pp->pos.Y, pp->pos.Z - Z(40), pp->cursector)) + if (cansee(actor->spr.pos.X, actor->spr.pos.Y, GetSpriteZOfTop(sp), actor->spr.sector(), pp->pos.X, pp->pos.Y, pp->pos.Z - Z(40), pp->cursector)) { if (i == 0 && !bosswasseen[0]) { diff --git a/source/games/sw/src/zilla.cpp b/source/games/sw/src/zilla.cpp index 48f2bb5c6..c0157155f 100644 --- a/source/games/sw/src/zilla.cpp +++ b/source/games/sw/src/zilla.cpp @@ -644,7 +644,7 @@ int SetupZilla(DSWActor* actor) USERp u; ANIMATOR DoActorDecide; - if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE)) + if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE)) { u = actor->u(); ASSERT(u); @@ -666,9 +666,9 @@ int SetupZilla(DSWActor* actor) EnemyDefaults(actor, &ZillaActionSet, &ZillaPersonality); - sp->clipdist = (512) >> 2; - sp->xrepeat = 97; - sp->yrepeat = 79; + actor->spr.clipdist = (512) >> 2; + actor->spr.xrepeat = 97; + actor->spr.yrepeat = 79; return 0; } @@ -681,19 +681,19 @@ int NullZilla(DSWActor* actor) #if 0 if (u->State == s_ZillaDie) { - getzsofslopeptr(sp->sector(), sp->pos.X, sp->y, &u->hiz, &u->loz); - u->lo_sectp = sp->sector(); - u->hi_sectp = sp->sector(); - sp->z = u->loz; + getzsofslopeptr(actor->spr.sector(), actor->spr.pos.X, actor->spr.y, &u->hiz, &u->loz); + u->lo_sectp = actor->spr.sector(); + u->hi_sectp = actor->spr.sector(); + actor->spr.z = u->loz; } #endif - getzsofslopeptr(sp->sector(), sp->pos.X, sp->pos.Y, &u->hiz, &u->loz); - u->lo_sectp = sp->sector(); - u->hi_sectp = sp->sector(); + getzsofslopeptr(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, &u->hiz, &u->loz); + u->lo_sectp = actor->spr.sector(); + u->hi_sectp = actor->spr.sector(); u->lowActor = nullptr; u->highActor = nullptr; - sp->pos.Z = u->loz; + actor->spr.pos.Z = u->loz; DoActorSectorDamage(actor); @@ -754,7 +754,7 @@ int DoZillaDeathMelt(DSWActor* actor) u->ID = ZILLA_RUN_R0; RESET(u->Flags, SPR_JUMPING|SPR_FALLING|SPR_MOVED); - //DoMatchEverything(nullptr, sp->lotag, ON); + //DoMatchEverything(nullptr, actor->spr.lotag, ON); if (!SW_SHAREWARE) { // Resume the regular music - in a hack-free fashion. @@ -762,12 +762,12 @@ int DoZillaDeathMelt(DSWActor* actor) } //KeepActorOnFloor(actor); - getzsofslopeptr(sp->sector(), sp->pos.X, sp->pos.Y, &u->hiz, &u->loz); - u->lo_sectp = sp->sector(); - u->hi_sectp = sp->sector(); + getzsofslopeptr(actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, &u->hiz, &u->loz); + u->lo_sectp = actor->spr.sector(); + u->hi_sectp = actor->spr.sector(); u->lowActor = nullptr; u->highActor = nullptr; - sp->pos.Z = u->loz; + actor->spr.pos.Z = u->loz; BossSpriteNum[2] = nullptr; return 0; diff --git a/source/games/sw/src/zombie.cpp b/source/games/sw/src/zombie.cpp index 1391c6fb5..09f235676 100644 --- a/source/games/sw/src/zombie.cpp +++ b/source/games/sw/src/zombie.cpp @@ -756,8 +756,8 @@ int SetupZombie(DSWActor* actor) u->Health = 100; u->StateEnd = &s_ZombiePain[0][0]; u->Rot = sg_ZombieRun; - sp->xrepeat = PLAYER_NINJA_XREPEAT; - sp->yrepeat = PLAYER_NINJA_YREPEAT; + actor->spr.xrepeat = PLAYER_NINJA_XREPEAT; + actor->spr.yrepeat = PLAYER_NINJA_YREPEAT; u->Attrib = &ZombieAttrib; EnemyDefaults(actor, &ZombieActionSet, &ZombiePersonality); @@ -810,8 +810,8 @@ void SpawnZombie2(DSWActor* actor) SPRITEp sp = &actor->s(); SPRITEp np; USERp nu; - auto sectu = sp->sector(); - SECTORp sectp = sp->sector(); + auto sectu = actor->spr.sector(); + SECTORp sectp = actor->spr.sector(); auto ownerActor = GetOwner(actor); @@ -821,19 +821,19 @@ void SpawnZombie2(DSWActor* actor) if (sectu && (TEST(sectp->extra, SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)) return; - if (SectorIsUnderwaterArea(sp->sector())) + if (SectorIsUnderwaterArea(actor->spr.sector())) return; - if (FAF_ConnectArea(sp->sector())) + if (FAF_ConnectArea(actor->spr.sector())) { - auto newsect = sp->sector(); - updatesectorz(sp->pos.X, sp->pos.Y, sp->pos.Z + Z(10), &newsect); + auto newsect = actor->spr.sector(); + updatesectorz(actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z + Z(10), &newsect); if (SectorIsUnderwaterArea(newsect)) return; } - auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], sp->sector(), sp->pos.X, sp->pos.Y, sp->pos.Z, sp->ang, 0); + auto actorNew = SpawnActor(STAT_ENEMY, ZOMBIE_RUN_R0, s_ZombieRun[0], actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 0); np = &actorNew->s(); nu = actorNew->u(); nu->Counter3 = 0;