From a74419f5e79fdce935b2068015664e0468db14f8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Jan 2021 18:30:56 +0100 Subject: [PATCH] - Exhumed: removed opos entirely. --- source/exhumed/src/map.cpp | 7 +++++-- source/exhumed/src/osdcmds.cpp | 6 +++--- source/exhumed/src/player.cpp | 2 -- source/exhumed/src/player.h | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index 8d61d0e5d..dcf8fd6d6 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -50,8 +50,11 @@ void DrawMap(double const smoothratio) { if (!nFreeze && automapMode != am_off) { - int x = PlayerList[nLocalPlayer].opos.x + MulScale(initx - PlayerList[nLocalPlayer].opos.x, smoothratio, 16); - int y = PlayerList[nLocalPlayer].opos.y + MulScale(inity - PlayerList[nLocalPlayer].opos.y, smoothratio, 16); + int nPlayerSprite = PlayerList[nLocalPlayer].nSprite; + auto psp = &sprite[nPlayerSprite]; + + int x = psp->interpolatedx(smoothratio); + int y = psp->interpolatedy(smoothratio); int ang = (!SyncInput() ? PlayerList[nLocalPlayer].angle.sum() : PlayerList[nLocalPlayer].angle.interpolatedsum(smoothratio)).asbuild(); DrawOverheadMap(x, y, ang, smoothratio); } diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index 06d6ccd7e..91ad52f39 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -39,9 +39,9 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz) Player *nPlayer = &PlayerList[nLocalPlayer]; spritetype *pSprite = &sprite[nPlayer->nSprite]; - nPlayer->opos.x = pSprite->x = x; - nPlayer->opos.y = pSprite->y = y; - nPlayer->opos.z = pSprite->z = z; + pSprite->x = x; + pSprite->y = y; + pSprite->z = z; if (ang != INT_MIN) { diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index fcf36a008..a0d3b0a45 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -335,7 +335,6 @@ void RestartPlayer(short nPlayer) floorspr = -1; } - plr->opos = nSpr->pos; plr->angle.backup(); plr->horizon.backup(); @@ -696,7 +695,6 @@ void FuncPlayer(int a, int nDamage, int nRun) short nSprite2; - PlayerList[nPlayer].opos = sprite[nPlayerSprite].pos; PlayerList[nPlayer].angle.backup(); PlayerList[nPlayer].horizon.backup(); PlayerList[nPlayer].angle.resetadjustment(); diff --git a/source/exhumed/src/player.h b/source/exhumed/src/player.h index d0d915757..577883603 100644 --- a/source/exhumed/src/player.h +++ b/source/exhumed/src/player.h @@ -75,7 +75,6 @@ struct Player PlayerHorizon horizon; PlayerAngle angle; - vec3_t opos; }; extern short PlayerCount;