From 8a455aa09bf9b1ff6c9ce99c1f9df2e1c6462bdb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 7 Oct 2022 21:21:23 +0200 Subject: [PATCH] - all remaining repeats outside weapon.cpp plus a few more. --- source/games/sw/src/player.cpp | 4 ++-- source/games/sw/src/ripper.cpp | 3 +-- source/games/sw/src/ripper2.cpp | 6 +++--- source/games/sw/src/serp.cpp | 6 ++---- source/games/sw/src/sprite.cpp | 2 +- source/games/sw/src/sumo.cpp | 6 ++---- source/games/sw/src/weapon.cpp | 18 +++++++++--------- source/games/sw/src/zilla.cpp | 3 +-- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 01121f152..d1b833ec6 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1350,7 +1350,7 @@ void DoSpawnTeleporterEffect(DSWActor* actor) SetActorZ(effectActor, effectActor->spr.pos); effectActor->spr.shade = -40; - effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42; + effectActor->spr.SetScale(0.65625, 0.65625); effectActor->spr.cstat |= (CSTAT_SPRITE_YCENTER); effectActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); @@ -1372,7 +1372,7 @@ void DoSpawnTeleporterEffectPlace(DSWActor* actor) SetActorZ(effectActor, effectActor->spr.pos); effectActor->spr.shade = -40; - effectActor->spr.xrepeat = effectActor->spr.yrepeat = 42; + effectActor->spr.SetScale(0.65625, 0.65625); effectActor->spr.cstat |= (CSTAT_SPRITE_YCENTER); effectActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 10ca141cb..8f7a25f3a 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -840,8 +840,7 @@ int SetupRipper(DSWActor* actor) if (actor->spr.pal == PALETTE_BROWN_RIPPER) { EnemyDefaults(actor, &RipperBrownActionSet, &RipperPersonality); - actor->spr.xrepeat = 106; - actor->spr.yrepeat = 90; + actor->spr.SetScale(1.65625, 1.40625); if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE)) actor->user.Health = HEALTH_MOMMA_RIPPER; diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index d417eff06..4a2cac5db 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -904,13 +904,13 @@ int SetupRipper2(DSWActor* actor) actor->user.StateEnd = s_Ripper2Die; actor->user.Rot = sg_Ripper2Run; actor->clipdist = 32; // This actor is bigger, needs bigger box. - actor->spr.xrepeat = actor->spr.yrepeat = 55; + actor->spr.SetScale(0.859375, 0.859375); if (actor->spr.pal == PALETTE_BROWN_RIPPER) { EnemyDefaults(actor, &Ripper2BrownActionSet, &Ripper2Personality); - actor->spr.xrepeat += 40; - actor->spr.yrepeat += 40; + actor->spr.AddScaleX(0.625); + actor->spr.AddScaleY(0.625); if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE)) actor->user.Health = HEALTH_MOMMA_RIPPER; diff --git a/source/games/sw/src/serp.cpp b/source/games/sw/src/serp.cpp index 0f51f8ef7..d2dec390f 100644 --- a/source/games/sw/src/serp.cpp +++ b/source/games/sw/src/serp.cpp @@ -718,13 +718,11 @@ int SetupSerp(DSWActor* actor) if (actor->spr.pal == 16) { actor->user.Health = 1000; - actor->spr.yrepeat = 74; - actor->spr.xrepeat = 74; + actor->spr.SetScale(1.15625, 1.15625); } else { - actor->spr.yrepeat = 100; - actor->spr.xrepeat = 128; + actor->spr.SetScale(1.5625, 2); } actor->clipdist = 32; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 884655e60..272405d45 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -5004,7 +5004,7 @@ int DoSpawnItemTeleporterEffect(DSWActor* actor) auto effect = SpawnActor(STAT_MISSILE, 0, s_TeleportEffect, actor->sector(), actor->spr.pos.plusZ(-12), actor->spr.angle); effect->spr.shade = -40; - effect->spr.xrepeat = effect->spr.yrepeat = 36; + effect->spr.SetScale(0.5625, 0.5625); effect->spr.cstat |= CSTAT_SPRITE_YCENTER; effect->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); return 0; diff --git a/source/games/sw/src/sumo.cpp b/source/games/sw/src/sumo.cpp index a1d39d038..0cc03fb89 100644 --- a/source/games/sw/src/sumo.cpp +++ b/source/games/sw/src/sumo.cpp @@ -628,15 +628,13 @@ int SetupSumo(DSWActor* actor) if (actor->spr.pal == 16) { // Mini Sumo - actor->spr.xrepeat = 43; - actor->spr.yrepeat = 29; + actor->spr.SetScale(0.671875, 0.453125); actor->user.ActorActionSet = &MiniSumoActionSet; actor->user.Health = 500; } else { - actor->spr.xrepeat = 115; - actor->spr.yrepeat = 75; + actor->spr.SetScale(1.796875, 1.171875); } //actor->user.Flags |= (SPR_XFLIP_TOGGLE); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 4f889e3d8..4dbe487e4 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3419,7 +3419,7 @@ AutoShrap: case SHRAP_EXPLOSION: { auto spnum = SpawnLargeExp(parentActor); - double size = spnum->spr.xrepeat + shrap_delta_size * REPEAT_SCALE; + double size = spnum->spr.ScaleX() + shrap_delta_size * REPEAT_SCALE; spnum->spr.SetScale(size, size); return false; @@ -3428,7 +3428,7 @@ AutoShrap: case SHRAP_LARGE_EXPLOSION: { auto spnum = SpawnLargeExp(parentActor); - double size = spnum->spr.xrepeat + shrap_delta_size * REPEAT_SCALE; + double size = spnum->spr.ScaleX() + shrap_delta_size * REPEAT_SCALE; spnum->spr.SetScale(size, size); InitPhosphorus(spnum); @@ -4589,7 +4589,7 @@ int DoFireballFlames(DSWActor* actor) actor->spr.xrepeat--; actor->spr.yrepeat--; - if (((int8_t)actor->spr.xrepeat) == 0) + if (actor->spr.ScaleX() <= 0) { if (actor->user.attachActor != nullptr) { @@ -4667,7 +4667,7 @@ int DoBreakFlames(DSWActor* actor) actor->spr.xrepeat--; actor->spr.yrepeat--; - if (((int8_t)actor->spr.xrepeat) == 0) + if (actor->spr.ScaleX() <= 0) { if (actor->user.attachActor != nullptr) { @@ -15059,7 +15059,7 @@ int DoCoolgDrip(DSWActor* actor) if (actor->spr.pos.Z > actor->user.loz - actor->user.floor_dist) { actor->spr.pos.Z = actor->user.loz - actor->user.floor_dist; - actor->spr.yrepeat = actor->spr.xrepeat = 32; + actor->spr.SetScale(0.5, 0.5); ChangeState(actor, s_GoreFloorSplash); if (actor->user.spal == PALETTE_BLUE_LIGHTING) PlaySound(DIGI_DRIP, actor, v3df_none); @@ -15080,7 +15080,7 @@ int InitCoolgDrip(DSWActor* actor) auto actorNew = SpawnActor(STAT_MISSILE, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.angle, 0); SetOwner(actor, actorNew); - actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20; + actorNew->spr.SetScale(0.3125, 0.3125); actorNew->spr.shade = -5; actorNew->vel.Z = 0; actorNew->clipdist = 1; @@ -15119,7 +15119,7 @@ int GenerateDrips(DSWActor* actor) auto actorNew = SpawnActor(STAT_SHRAP, COOLG_DRIP, s_CoolgDrip, actor->sector(), actor->spr.pos, actor->spr.angle, 0); SetOwner(actor, actorNew); - actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20; + actorNew->spr.SetScale(0.3125, 0.3125); actorNew->spr.shade = -10; actorNew->vel.Z = 0; actorNew->clipdist = 1; @@ -17570,8 +17570,8 @@ DSWActor* SpawnBubble(DSWActor* actor) auto actorNew = SpawnActor(STAT_MISSILE, BUBBLE, s_Bubble, actor->sector(), actor->spr.pos, actor->spr.angle, 0); - actorNew->spr.xrepeat = 8 + (RANDOM_P2(8 << 8) >> 8); - actorNew->spr.yrepeat = actorNew->spr.xrepeat; + double scale = (8 + (RANDOM_P2(8 << 8) >> 8)) * REPEAT_SCALE; + actorNew->spr.SetScale(scale, scale); // notreallypos actorNew->user.pos.X = actorNew->spr.xrepeat; actorNew->user.pos.Y = actorNew->spr.yrepeat; diff --git a/source/games/sw/src/zilla.cpp b/source/games/sw/src/zilla.cpp index 59876ecd3..ce28b01de 100644 --- a/source/games/sw/src/zilla.cpp +++ b/source/games/sw/src/zilla.cpp @@ -631,8 +631,7 @@ int SetupZilla(DSWActor* actor) EnemyDefaults(actor, &ZillaActionSet, &ZillaPersonality); actor->clipdist = 32; - actor->spr.xrepeat = 97; - actor->spr.yrepeat = 79; + actor->spr.SetScale(1.515625, 1.23475); return 0; }