From 8ff62c5a073516d5630f37110eedaf67025141a9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Aug 2022 12:50:00 +0200 Subject: [PATCH] - sone remaining int_ppos. --- source/games/sw/src/game.h | 2 +- source/games/sw/src/osdcmds.cpp | 4 ++-- source/games/sw/src/player.cpp | 28 +++++++++++++--------------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 824ee1049..4aa18f73e 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2015,7 +2015,7 @@ inline bool SectorIsUnderwaterArea(sectortype* sect) inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, int range) { - return (abs(getincangle(getangle(a->int_pos().X - (pp)->__int_ppos.X, a->int_pos().Y - (pp)->__int_ppos.Y), (pp)->angle.ang.Buildang())) < (range)); + return (abs(getincangle(getangle(a->int_pos().X - (pp)->int_ppos().X, a->int_pos().Y - (pp)->int_ppos().Y), (pp)->angle.ang.Buildang())) < (range)); } inline bool FacingRange(DSWActor* a1, DSWActor* a2, int range) diff --git a/source/games/sw/src/osdcmds.cpp b/source/games/sw/src/osdcmds.cpp index b18f35c68..721fae91b 100644 --- a/source/games/sw/src/osdcmds.cpp +++ b/source/games/sw/src/osdcmds.cpp @@ -50,8 +50,8 @@ BEGIN_SW_NS void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) { - Player->__int_ppos = { x,y,z }; - Player->__int_popos = Player->__int_ppos; + Player->set_int_ppos({x,y,z}); + Player->__int_popos = Player->int_ppos(); if (ang != INT_MIN) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 0ba675b01..4f9f11260 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1280,16 +1280,16 @@ void DoPlayerTeleportToSprite(PLAYER* pp, vec3_t* pos, int ang) pp->set_int_ppos_Z(pos->Z - PLAYER_HEIGHT); pp->__int_popos.Z = pp->int_ppos().Z; - updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); + updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector); pp->Flags2 |= (PF2_TELEPORTED); } void DoPlayerTeleportToOffset(PLAYER* pp) { - pp->__int_popos.X = pp->__int_poldpos.X = pp->__int_ppos.X; - pp->__int_popos.Y = pp->__int_poldpos.Y = pp->__int_ppos.Y; + pp->__int_popos.X = pp->__int_poldpos.X = pp->int_ppos().X; + pp->__int_popos.Y = pp->__int_poldpos.Y = pp->int_ppos().Y; - updatesector(pp->__int_ppos.X, pp->__int_ppos.Y, &pp->cursector); + updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector); pp->Flags2 |= (PF2_TELEPORTED); } @@ -1988,7 +1988,7 @@ void DoPlayerMove(PLAYER* pp) DoPlayerTurn(pp, pp->input.avel, 1); } - pp->__int_poldpos = pp->__int_ppos; + pp->__int_poldpos = pp->int_ppos(); pp->lastcursector = pp->cursector; if (PLAYER_MOVING(pp) == 0) @@ -2036,8 +2036,7 @@ void DoPlayerMove(PLAYER* pp) auto sect = pp->cursector; if (interpolate_ride) { - pp->__int_popos.X = pp->__int_ppos.X; - pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.XY() = pp->int_ppos().XY(); } pp->__int_ppos.X += pp->vect.X >> 14; pp->__int_ppos.Y += pp->vect.Y >> 14; @@ -2063,8 +2062,7 @@ void DoPlayerMove(PLAYER* pp) if (interpolate_ride) { - pp->__int_popos.X = pp->__int_ppos.X; - pp->__int_popos.Y = pp->__int_ppos.Y; + pp->__int_popos.XY() = pp->int_ppos().XY(); } auto save_cstat = actor->spr.cstat; @@ -2093,7 +2091,7 @@ void DoPlayerMove(PLAYER* pp) if (interpolate_ride) { - pp->__int_popos.Z = pp->__int_ppos.Z; + pp->__int_popos.Z = pp->int_ppos().Z; pp->angle.backup(); } @@ -3533,7 +3531,7 @@ void PlayerWarpUpdatePos(PLAYER* pp) if (Prediction) return; - pp->__int_popos = pp->__int_ppos; + pp->__int_popos = pp->int_ppos(); DoPlayerZrange(pp); UpdatePlayerSprite(pp); } @@ -4036,7 +4034,7 @@ void DoPlayerWarpToUnderwater(PLAYER* pp) pp->set_int_ppos_Z(under_act->sector()->int_ceilingz() + Z(6)); - pp->__int_popos = pp->__int_ppos; + pp->__int_popos = pp->int_ppos(); DoPlayerZrange(pp); return; @@ -4106,7 +4104,7 @@ void DoPlayerWarpToSurface(PLAYER* pp) pp->add_int_ppos_Z(-Z(pp->WadeDepth)); - pp->__int_popos = pp->__int_ppos; + pp->__int_popos = pp->int_ppos(); return; } @@ -6347,7 +6345,7 @@ void MoveSkipSavePos(void) { pp = Player + pnum; - pp->__int_popos = pp->__int_ppos; + pp->__int_popos = pp->int_ppos(); pp->obob_z = pp->bob_z; pp->angle.backup(); pp->horizon.backup(); @@ -6677,7 +6675,7 @@ void InitAllPlayers(void) // Initialize all [MAX_SW_PLAYERS] arrays here! for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++) { - pp->__int_ppos = pp->__int_popos = pfirst->__int_ppos; + pp->__int_ppos = pp->__int_popos = pfirst->int_ppos(); pp->angle.ang = pp->angle.oang = pfirst->angle.ang; pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz; pp->cursector = pfirst->cursector;