From e8f9afb174f2574b55d3447ca29cf702895d7730 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 29 Oct 2021 21:06:37 +0200 Subject: [PATCH] - DoScaleSprite. --- source/games/sw/src/actor.cpp | 7 +++---- source/games/sw/src/bunny.cpp | 2 +- source/games/sw/src/misc.h | 2 +- source/games/sw/src/ripper.cpp | 2 +- source/games/sw/src/ripper2.cpp | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index bf49f5d36..732a7568a 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -58,11 +58,10 @@ extern STATEp sg_NinjaGrabThroat[]; int DoActorStopFall(DSWActor* actor); -int -DoScaleSprite(short SpriteNum) +int DoScaleSprite(DSWActor* actor) { - SPRITEp sp = &sprite[SpriteNum]; - USERp u = User[SpriteNum].Data(); + auto u = actor->u(); + auto sp = &actor->s(); int scale_value; if (u->scale_speed) diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index d63d61fb2..dc5988ae3 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -1335,7 +1335,7 @@ DoBunnyMove(DSWActor* actor) if (u->scale_speed) { - DoScaleSprite(SpriteNum); + DoScaleSprite(actor); } if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) diff --git a/source/games/sw/src/misc.h b/source/games/sw/src/misc.h index b4f733ed9..1adc37e89 100644 --- a/source/games/sw/src/misc.h +++ b/source/games/sw/src/misc.h @@ -68,7 +68,7 @@ int DoFall(short SpriteNum); void KeepActorOnFloor(short SpriteNum); int DoActorSlide(DSWActor* actor); int DoActorSectorDamage(DSWActor* actor); -int DoScaleSprite(short SpriteNum); +int DoScaleSprite(DSWActor* actor); void InitPlayerSprite(PLAYERp pp); void InitAllPlayerSprites(void); diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 808894cee..59238382f 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1296,7 +1296,7 @@ DoRipperMove(DSWActor* actor) if (u->scale_speed) { - DoScaleSprite(SpriteNum); + DoScaleSprite(actor); } if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index 830f560cb..159a00ab6 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1314,7 +1314,7 @@ DoRipper2Move(DSWActor* actor) if (u->scale_speed) { - DoScaleSprite(SpriteNum); + DoScaleSprite(actor); } if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))