From ae50767c703aa1ce599d37db59661db17634988b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 22 Dec 2021 22:52:02 +1100 Subject: [PATCH] - SW: Replace `PLAYERstruct` `oposx` with `opos.X` calls. --- source/games/sw/src/draw.cpp | 4 ++-- source/games/sw/src/game.h | 4 ++-- source/games/sw/src/jsector.cpp | 2 +- source/games/sw/src/osdcmds.cpp | 2 +- source/games/sw/src/player.cpp | 20 ++++++++++---------- source/games/sw/src/save.cpp | 2 +- source/games/sw/src/sprite.cpp | 2 +- wadsrc/static/zscript/games/sw/swgame.zs | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index a7c65c0eb..a7abf462d 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -824,7 +824,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie { PLAYERp pp = tu->PlayerP; int sr = 65536 - int(smoothratio); - tsp->pos.X -= MulScale(pp->pos.X - pp->oposx, sr, 16); + tsp->pos.X -= MulScale(pp->pos.X - pp->opos.X, sr, 16); tsp->pos.Y -= MulScale(pp->pos.Y - pp->oposy, sr, 16); tsp->pos.Z -= MulScale(pp->pos.Z - pp->oposz, sr, 16); tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16); @@ -1458,7 +1458,7 @@ void drawscreen(PLAYERp pp, double smoothratio) else camerapp = pp; - tx = interpolatedvalue(camerapp->oposx, camerapp->pos.X, sr); + tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr); ty = interpolatedvalue(camerapp->oposy, camerapp->pos.Y, sr); tz = interpolatedvalue(camerapp->oposz, camerapp->pos.Z, sr); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index e7314510a..7fcdfa06b 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -661,7 +661,7 @@ typedef struct struct PLAYERstruct { // variable that fit in the sprite or user structure - vec3_t pos; + vec3_t pos, opos; TObjPtr actor; TObjPtr lowActor, highActor; @@ -677,7 +677,7 @@ struct PLAYERstruct } // interpolation - int oposx, oposy, oposz; + int oposy, oposz; // holds last valid move position int lv_x,lv_y,lv_z; diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index d0b2441a5..9c3544453 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -641,7 +641,7 @@ void JS_DrawCameras(PLAYERp pp, int tx, int ty, int tz, double smoothratio) // If player is dead still then update at MoveSkip4 // rate. - if (pp->pos.X == pp->oposx && pp->pos.Y == pp->oposy && pp->pos.Z == pp->oposz) + if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->oposy && pp->pos.Z == pp->oposz) DoCam = true; diff --git a/source/games/sw/src/osdcmds.cpp b/source/games/sw/src/osdcmds.cpp index 2c2f16209..bc6701515 100644 --- a/source/games/sw/src/osdcmds.cpp +++ b/source/games/sw/src/osdcmds.cpp @@ -51,7 +51,7 @@ BEGIN_SW_NS void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) { - Player->oposx = Player->pos.X = x; + Player->opos.X = Player->pos.X = x; Player->oposy = Player->pos.Y = y; Player->oposz = Player->pos.Z = z; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 2e72c4796..40c961551 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1280,7 +1280,7 @@ void DoPlayerTeleportPause(PLAYERp pp) void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang) { pp->angle.ang = pp->angle.oang = buildang(ang); - pp->pos.X = pp->oposx = pp->oldposx = sp->X; + pp->pos.X = pp->opos.X = pp->oldposx = sp->X; pp->pos.Y = pp->oposy = pp->oldposy = sp->Y; //getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz); @@ -1294,7 +1294,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang) void DoPlayerTeleportToOffset(PLAYERp pp) { - pp->oposx = pp->oldposx = pp->pos.X; + pp->opos.X = pp->oldposx = pp->pos.X; pp->oposy = pp->oldposy = pp->pos.Y; updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); @@ -2081,7 +2081,7 @@ void DoPlayerMove(PLAYERp pp) auto sect = pp->cursector; if (interpolate_ride) { - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; } pp->pos.X += pp->xvect >> 14; @@ -2108,7 +2108,7 @@ void DoPlayerMove(PLAYERp pp) if (interpolate_ride) { - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; } @@ -3603,7 +3603,7 @@ void PlayerWarpUpdatePos(PLAYERp pp) if (Prediction) return; - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; pp->oposz = pp->pos.Z; DoPlayerZrange(pp); @@ -4119,7 +4119,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp) pp->pos.Z = under_sp->sector()->ceilingz + Z(6); - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; pp->oposz = pp->pos.Z; @@ -4197,7 +4197,7 @@ void DoPlayerWarpToSurface(PLAYERp pp) pp->pos.Z -= Z(pp->WadeDepth); - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; pp->oposz = pp->pos.Z; @@ -6485,7 +6485,7 @@ void MoveSkipSavePos(void) { pp = Player + pnum; - pp->oposx = pp->pos.X; + pp->opos.X = pp->pos.X; pp->oposy = pp->pos.Y; pp->oposz = pp->pos.Z; pp->obob_z = pp->bob_z; @@ -6825,7 +6825,7 @@ void InitAllPlayers(void) // Initialize all [MAX_SW_PLAYERS] arrays here! for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++) { - pp->pos.X = pp->oposx = pfirst->pos.X; + pp->pos.X = pp->opos.X = pfirst->pos.X; pp->pos.Y = pp->oposy = pfirst->pos.Y; pp->pos.Z = pp->oposz = pfirst->pos.Z; pp->angle.ang = pp->angle.oang = pfirst->angle.ang; @@ -6982,7 +6982,7 @@ void PlayerSpawnPosition(PLAYERp pp) sp = &spawn_sprite->s(); - pp->pos.X = pp->oposx = sp->pos.X; + pp->pos.X = pp->opos.X = sp->pos.X; pp->pos.Y = pp->oposy = sp->pos.Y; pp->pos.Z = pp->oposz = sp->pos.Z; pp->angle.ang = pp->angle.oang = buildang(sp->ang); diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 2f74386ab..f0b928817 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -580,7 +580,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P } if (arc.isReading()) { - w.oposx = w.pos.X; + w.opos.X = w.pos.X; w.oposy = w.pos.X; w.oposz = w.pos.X; w.oz_speed = w.z_speed; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 5e446a5be..f7d12569d 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1531,7 +1531,7 @@ void PreMapCombineFloors(void) { pp->pos.X += dx; pp->pos.Y += dy; - pp->oposx = pp->oldposx = pp->pos.X; + pp->opos.X = pp->oldposx = pp->pos.X; pp->oposy = pp->oldposy = pp->pos.Y; break; } diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 51debaa6c..3875ae672 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -152,7 +152,7 @@ struct SWPlayer native */ // interpolation - //int oposx, oposy, oposz; + //int oposy, oposz; // holds last valid move position //int16 lv_sectnum;