From acc11f34bf6e26753e2a1ba66dc1b07469bdbc35 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 30 Dec 2021 17:42:34 +1100 Subject: [PATCH] - SW: Replace `PLAYERstruct` `RevolveX` with `Revolve.X` calls. --- source/games/sw/src/game.h | 3 ++- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/save.cpp | 2 +- source/games/sw/src/track.cpp | 10 +++++----- wadsrc/static/zscript/games/sw/swgame.zs | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 7c4d72d1c..95811a1c0 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -663,7 +663,8 @@ struct PLAYERstruct fixed_t recoil_ohorizoff, recoil_horizoff; int oldposx,oldposy,oldposz; - int RevolveX, RevolveY; + vec3_t Revolve; + int RevolveY; int16_t RevolveDeltaAng; binangle RevolveAng; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 9ce29cddf..ed82a5137 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -7113,7 +7113,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_ohorizoff) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposx) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposy) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposz) -DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveX) +//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Revolve.X) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveY) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveDeltaAng) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, pnum) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 6e61b898d..86bfc3fc9 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -492,7 +492,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P ("oldposx", w.oldposx) ("oldposy", w.oldposy) ("oldposz", w.oldposz) - ("revolvex", w.RevolveX) + ("revolvex", w.Revolve.X) ("revolvey", w.RevolveY) ("RevolveDeltaAng", w.RevolveDeltaAng) ("RevolveAng", w.RevolveAng) diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 3981c3e9a..1c4fce8d1 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -733,7 +733,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop) if (pp->posx > xlow && pp->posx < xhigh && pp->posy > ylow && pp->posy < yhigh) { pp->RevolveAng = pp->angle.ang; - pp->RevolveX = pp->posx; + pp->Revolve.X = pp->pos.X; pp->RevolveY = pp->posy; pp->RevolveDeltaAng = 0; pp->Flags |= (PF_PLAYER_RIDING); @@ -1524,7 +1524,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny) pp->Flags |= (PF_PLAYER_RIDING); pp->RevolveAng = pp->angle.ang; - pp->RevolveX = pp->pos.X; + pp->Revolve.X = pp->pos.X; pp->RevolveY = pp->pos.Y; // set the delta angle to 0 when moving @@ -1548,7 +1548,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny) // moving then you // know where he was last pp->RevolveAng = pp->angle.ang; - pp->RevolveX = pp->pos.X; + pp->Revolve.X = pp->pos.X; pp->RevolveY = pp->pos.Y; // set the delta angle to 0 when moving @@ -1559,7 +1559,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny) // Player is NOT moving // Move saved x&y variables - pp->RevolveX += nx; + pp->Revolve.X += nx; pp->RevolveY += ny; // Last known angle is now adjusted by the delta angle @@ -1569,7 +1569,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny) // increment Players delta angle pp->RevolveDeltaAng = NORM_ANGLE(pp->RevolveDeltaAng + GlobSpeedSO); - rotatepoint(sop->pmid.vec2, *(vec2_t *)&pp->RevolveX, pp->RevolveDeltaAng, &pp->pos.vec2); + rotatepoint(sop->pmid.vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng, &pp->pos.vec2); // THIS WAS CAUSING PROLEMS!!!! // Sectors are still being manipulated so you can end up in a void (-1) sector diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 8a18cf189..adb9ec4fc 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -220,7 +220,7 @@ struct SWPlayer native native int recoil_horizoff; native int oldposx,oldposy,oldposz; - native int RevolveX, RevolveY; + native int RevolveY; native int16 RevolveDeltaAng; native int16 pnum; // carry along the player number