From 85412a39e6eb21a69b44811f2415205ee460a306 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 10 Sep 2022 22:05:36 +1000 Subject: [PATCH] - Blood: Eliminate `VIEW::pos`. --- source/games/blood/src/osdcmd.cpp | 6 ++---- source/games/blood/src/view.cpp | 9 ++++----- source/games/blood/src/view.h | 1 - 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source/games/blood/src/osdcmd.cpp b/source/games/blood/src/osdcmd.cpp index 17ad1a685..0ba323490 100644 --- a/source/games/blood/src/osdcmd.cpp +++ b/source/games/blood/src/osdcmd.cpp @@ -36,10 +36,8 @@ void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang, int h PLAYER* pPlayer = &gPlayer[myconnectindex]; VIEW* pView = &gPrevView[myconnectindex]; - gView->actor->spr.pos.XY() = { x , y }; - pPlayer->actor->spr.pos.XY() = gView->actor->spr.pos.XY(); - pView->pos.XY() = gView->actor->spr.pos.XY(); - pPlayer->zView = pView->viewz = gView->zView = z; + pPlayer->actor->opos.XY() = pPlayer->actor->spr.pos.XY() = { x , y }; + pView->viewz = gView->zView = z; if (ang != DAngle::fromDeg(INT_MIN)) { diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 87c873b0f..f0d13ecbd 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -61,7 +61,6 @@ void viewBackupView(int nPlayer) { PLAYER* pPlayer = &gPlayer[nPlayer]; VIEW* pView = &gPrevView[nPlayer]; - pView->pos.XY() = pPlayer->actor->spr.pos.XY(); pView->viewz = pPlayer->zView; pView->weaponZ = pPlayer->zWeapon - pPlayer->zView - 0xc00; pView->horiz = pPlayer->horizon.horiz; @@ -87,7 +86,7 @@ void viewCorrectViewOffsets(int nPlayer, const DVector3& oldpos) { PLAYER* pPlayer = &gPlayer[nPlayer]; VIEW* pView = &gPrevView[nPlayer]; - pView->pos.XY() += pPlayer->actor->spr.pos.XY() - oldpos.XY(); + pPlayer->actor->opos.XY() += pPlayer->actor->spr.pos.XY() - oldpos.XY(); pView->viewz += (pPlayer->actor->spr.pos.Z - oldpos.Z) * zworldtoint; } @@ -468,7 +467,7 @@ static void DrawMap(DBloodActor* view, const double smoothratio) } VIEW* pView = &gPrevView[gViewIndex]; auto ang = !SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(smoothratio * (1. / MaxSmoothRatio)); - DrawOverheadMap(interpolatedvalue(pView->pos, view->spr.pos, smoothratio * (1. / MaxSmoothRatio)).XY(), ang, smoothratio * (1. / MaxSmoothRatio)); + DrawOverheadMap(view->interpolatedpos(smoothratio * (1. / MaxSmoothRatio)).XY(), ang, smoothratio * (1. / MaxSmoothRatio)); if (tm) setViewport(hud_size); } @@ -514,8 +513,8 @@ static void SetupView(int& cX, int& cY, int& cZ, DAngle& cA, fixedhoriz& cH, sec #endif { VIEW* pView = &gPrevView[gViewIndex]; - cX = interpolatedvalue(pView->pos.X, gView->actor->spr.pos.X, smoothratio * (1. / MaxSmoothRatio)) * worldtoint; - cY = interpolatedvalue(pView->pos.Y, gView->actor->spr.pos.Y, smoothratio * (1. / MaxSmoothRatio)) * worldtoint; + cX = interpolatedvalue(gView->actor->opos.X, gView->actor->spr.pos.X, smoothratio * (1. / MaxSmoothRatio)) * worldtoint; + cY = interpolatedvalue(gView->actor->opos.Y, gView->actor->spr.pos.Y, smoothratio * (1. / MaxSmoothRatio)) * worldtoint; cZ = interpolatedvalue(pView->viewz, gView->zView, smoothratio * (1. / MaxSmoothRatio)); zDelta = interpolatedvalue(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), smoothratio * (1. / MaxSmoothRatio)); bobWidth = interpolatedvalue(pView->bobWidth, gView->bobWidth, smoothratio * (1. / MaxSmoothRatio)); diff --git a/source/games/blood/src/view.h b/source/games/blood/src/view.h index 12f9e3bb6..08f13e532 100644 --- a/source/games/blood/src/view.h +++ b/source/games/blood/src/view.h @@ -50,7 +50,6 @@ struct VIEW { int zWeaponVel; int posture; // posture double spin; // spin - DVector3 pos; int xvel; //xvel int yvel; //yvel int zvel; //zvel