- Blood: Eliminate VIEW::pos.

This commit is contained in:
Mitchell Richters 2022-09-10 22:05:36 +10:00 committed by Christoph Oelckers
parent 80121f6021
commit 85412a39e6
3 changed files with 6 additions and 10 deletions

View file

@ -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))
{

View file

@ -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<double>(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), smoothratio * (1. / MaxSmoothRatio));
bobWidth = interpolatedvalue(pView->bobWidth, gView->bobWidth, smoothratio * (1. / MaxSmoothRatio));

View file

@ -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