- SW: Replace PLAYERstruct oposz with opos.Z calls.

This commit is contained in:
Mitchell Richters 2021-12-22 22:53:07 +11:00 committed by Christoph Oelckers
parent a2f2cc489a
commit 6423684bfb
7 changed files with 15 additions and 20 deletions

View file

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

View file

@ -676,9 +676,6 @@ struct PLAYERstruct
return actor;
}
// interpolation
int oposz;
// holds last valid move position
int lv_x,lv_y,lv_z;

View file

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

View file

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

View file

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

View file

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

View file

@ -151,8 +151,6 @@ struct SWPlayer native
};
*/
// interpolation
//int oposz;
// holds last valid move position
//int16 lv_sectnum;