diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 7bcb5dab6..60f79cf4e 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -826,7 +826,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie int sr = 65536 - int(smoothratio); tsp->pos.X -= MulScale(pp->pos.X - pp->opos.X, sr, 16); tsp->pos.Y -= MulScale(pp->pos.Y - pp->opos.Y, sr, 16); - tsp->pos.Z -= MulScale(pp->pos.Z - pp->oposz, sr, 16); + tsp->pos.Z -= MulScale(pp->pos.Z - pp->opos.Z, sr, 16); tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16); } } @@ -1460,7 +1460,7 @@ void drawscreen(PLAYERp pp, double smoothratio) tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr); ty = interpolatedvalue(camerapp->opos.Y, camerapp->pos.Y, sr); - tz = interpolatedvalue(camerapp->oposz, camerapp->pos.Z, sr); + tz = interpolatedvalue(camerapp->opos.Z, camerapp->pos.Z, sr); // Interpolate the player's angle while on a sector object, just like VoidSW. // This isn't needed for the turret as it was fixable, but moving sector objects are problematic. diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 6a61d5923..b90b20eab 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -676,9 +676,6 @@ struct PLAYERstruct return actor; } - // interpolation - int 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 5e56bfd9a..5d96aa545 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->opos.X && pp->pos.Y == pp->opos.Y && pp->pos.Z == pp->oposz) + if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->opos.Y && pp->pos.Z == pp->opos.Z) DoCam = true; diff --git a/source/games/sw/src/osdcmds.cpp b/source/games/sw/src/osdcmds.cpp index b1ee088f5..d2370e3f7 100644 --- a/source/games/sw/src/osdcmds.cpp +++ b/source/games/sw/src/osdcmds.cpp @@ -53,7 +53,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) { Player->opos.X = Player->pos.X = x; Player->opos.Y = Player->pos.Y = y; - Player->oposz = Player->pos.Z = z; + Player->opos.Z = Player->pos.Z = z; if (ang != INT_MIN) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index d367d6da4..265a571a6 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1286,7 +1286,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang) //getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz); //pp->posz = pp->oposz = fz - PLAYER_HEIGHT; - pp->pos.Z = pp->oposz = sp->Z - PLAYER_HEIGHT; + pp->pos.Z = pp->opos.Z = sp->Z - PLAYER_HEIGHT; updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); SET(pp->Flags2, PF2_TELEPORTED); @@ -2138,7 +2138,7 @@ void DoPlayerMove(PLAYERp pp) if (interpolate_ride) { - pp->oposz = pp->pos.Z; + pp->opos.Z = pp->pos.Z; pp->angle.backup(); } @@ -3605,7 +3605,7 @@ void PlayerWarpUpdatePos(PLAYERp pp) pp->opos.X = pp->pos.X; pp->opos.Y = pp->pos.Y; - pp->oposz = pp->pos.Z; + pp->opos.Z = pp->pos.Z; DoPlayerZrange(pp); UpdatePlayerSprite(pp); } @@ -4121,7 +4121,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp) pp->opos.X = pp->pos.X; pp->opos.Y = pp->pos.Y; - pp->oposz = pp->pos.Z; + pp->opos.Z = pp->pos.Z; DoPlayerZrange(pp); return; @@ -4199,7 +4199,7 @@ void DoPlayerWarpToSurface(PLAYERp pp) pp->opos.X = pp->pos.X; pp->opos.Y = pp->pos.Y; - pp->oposz = pp->pos.Z; + pp->opos.Z = pp->pos.Z; return; } @@ -6487,7 +6487,7 @@ void MoveSkipSavePos(void) pp->opos.X = pp->pos.X; pp->opos.Y = pp->pos.Y; - pp->oposz = pp->pos.Z; + pp->opos.Z = pp->pos.Z; pp->obob_z = pp->bob_z; pp->angle.backup(); pp->horizon.backup(); @@ -6827,7 +6827,7 @@ void InitAllPlayers(void) { pp->pos.X = pp->opos.X = pfirst->pos.X; pp->pos.Y = pp->opos.Y = pfirst->pos.Y; - pp->pos.Z = pp->oposz = pfirst->pos.Z; + pp->pos.Z = pp->opos.Z = pfirst->pos.Z; pp->angle.ang = pp->angle.oang = pfirst->angle.ang; pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz; pp->cursector = pfirst->cursector; @@ -6984,7 +6984,7 @@ void PlayerSpawnPosition(PLAYERp pp) pp->pos.X = pp->opos.X = sp->pos.X; pp->pos.Y = pp->opos.Y = sp->pos.Y; - pp->pos.Z = pp->oposz = sp->pos.Z; + pp->pos.Z = pp->opos.Z = sp->pos.Z; pp->angle.ang = pp->angle.oang = buildang(sp->ang); pp->setcursector(sp->sector()); @@ -6992,7 +6992,7 @@ void PlayerSpawnPosition(PLAYERp pp) // if too close to the floor - stand up if (pp->pos.Z > fz - PLAYER_HEIGHT) { - pp->pos.Z = pp->oposz = fz - PLAYER_HEIGHT; + pp->pos.Z = pp->opos.Z = fz - PLAYER_HEIGHT; } } diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index e3334e286..8792e058d 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -582,7 +582,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P { w.opos.X = w.pos.X; w.opos.Y = w.pos.X; - w.oposz = w.pos.X; + w.opos.Z = w.pos.X; w.oz_speed = w.z_speed; w.oxvect = w.xvect; w.oyvect = w.yvect; diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 7ad69c8e2..73c236fce 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -150,9 +150,7 @@ struct SWPlayer native vec3_t pos; }; */ - - // interpolation - //int oposz; + // holds last valid move position //int16 lv_sectnum;