- SW: Replace PLAYERstruct oposx with opos.X calls.

This commit is contained in:
Mitchell Richters 2021-12-22 22:52:02 +11:00 committed by Christoph Oelckers
parent 05a4ad4729
commit ae50767c70
8 changed files with 19 additions and 19 deletions

View file

@ -824,7 +824,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
{
PLAYERp pp = tu->PlayerP;
int sr = 65536 - int(smoothratio);
tsp->pos.X -= MulScale(pp->pos.X - pp->oposx, sr, 16);
tsp->pos.X -= MulScale(pp->pos.X - pp->opos.X, sr, 16);
tsp->pos.Y -= MulScale(pp->pos.Y - pp->oposy, sr, 16);
tsp->pos.Z -= MulScale(pp->pos.Z - pp->oposz, sr, 16);
tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16);
@ -1458,7 +1458,7 @@ void drawscreen(PLAYERp pp, double smoothratio)
else
camerapp = pp;
tx = interpolatedvalue(camerapp->oposx, camerapp->pos.X, sr);
tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr);
ty = interpolatedvalue(camerapp->oposy, camerapp->pos.Y, sr);
tz = interpolatedvalue(camerapp->oposz, camerapp->pos.Z, sr);

View file

@ -661,7 +661,7 @@ typedef struct
struct PLAYERstruct
{
// variable that fit in the sprite or user structure
vec3_t pos;
vec3_t pos, opos;
TObjPtr<DSWActor*> actor;
TObjPtr<DSWActor*> lowActor, highActor;
@ -677,7 +677,7 @@ struct PLAYERstruct
}
// interpolation
int oposx, oposy, oposz;
int oposy, 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->oposx && pp->pos.Y == pp->oposy && pp->pos.Z == pp->oposz)
if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->oposy && pp->pos.Z == pp->oposz)
DoCam = true;

View file

@ -51,7 +51,7 @@ BEGIN_SW_NS
void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
{
Player->oposx = Player->pos.X = x;
Player->opos.X = Player->pos.X = x;
Player->oposy = Player->pos.Y = y;
Player->oposz = Player->pos.Z = z;

View file

@ -1280,7 +1280,7 @@ void DoPlayerTeleportPause(PLAYERp pp)
void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang)
{
pp->angle.ang = pp->angle.oang = buildang(ang);
pp->pos.X = pp->oposx = pp->oldposx = sp->X;
pp->pos.X = pp->opos.X = pp->oldposx = sp->X;
pp->pos.Y = pp->oposy = pp->oldposy = sp->Y;
//getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz);
@ -1294,7 +1294,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang)
void DoPlayerTeleportToOffset(PLAYERp pp)
{
pp->oposx = pp->oldposx = pp->pos.X;
pp->opos.X = pp->oldposx = pp->pos.X;
pp->oposy = pp->oldposy = pp->pos.Y;
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
@ -2081,7 +2081,7 @@ void DoPlayerMove(PLAYERp pp)
auto sect = pp->cursector;
if (interpolate_ride)
{
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
}
pp->pos.X += pp->xvect >> 14;
@ -2108,7 +2108,7 @@ void DoPlayerMove(PLAYERp pp)
if (interpolate_ride)
{
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
}
@ -3603,7 +3603,7 @@ void PlayerWarpUpdatePos(PLAYERp pp)
if (Prediction)
return;
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
pp->oposz = pp->pos.Z;
DoPlayerZrange(pp);
@ -4119,7 +4119,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
pp->pos.Z = under_sp->sector()->ceilingz + Z(6);
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
pp->oposz = pp->pos.Z;
@ -4197,7 +4197,7 @@ void DoPlayerWarpToSurface(PLAYERp pp)
pp->pos.Z -= Z(pp->WadeDepth);
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
pp->oposz = pp->pos.Z;
@ -6485,7 +6485,7 @@ void MoveSkipSavePos(void)
{
pp = Player + pnum;
pp->oposx = pp->pos.X;
pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y;
pp->oposz = pp->pos.Z;
pp->obob_z = pp->bob_z;
@ -6825,7 +6825,7 @@ void InitAllPlayers(void)
// Initialize all [MAX_SW_PLAYERS] arrays here!
for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++)
{
pp->pos.X = pp->oposx = pfirst->pos.X;
pp->pos.X = pp->opos.X = pfirst->pos.X;
pp->pos.Y = pp->oposy = pfirst->pos.Y;
pp->pos.Z = pp->oposz = pfirst->pos.Z;
pp->angle.ang = pp->angle.oang = pfirst->angle.ang;
@ -6982,7 +6982,7 @@ void PlayerSpawnPosition(PLAYERp pp)
sp = &spawn_sprite->s();
pp->pos.X = pp->oposx = sp->pos.X;
pp->pos.X = pp->opos.X = sp->pos.X;
pp->pos.Y = pp->oposy = sp->pos.Y;
pp->pos.Z = pp->oposz = sp->pos.Z;
pp->angle.ang = pp->angle.oang = buildang(sp->ang);

View file

@ -580,7 +580,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
}
if (arc.isReading())
{
w.oposx = w.pos.X;
w.opos.X = w.pos.X;
w.oposy = w.pos.X;
w.oposz = w.pos.X;
w.oz_speed = w.z_speed;

View file

@ -1531,7 +1531,7 @@ void PreMapCombineFloors(void)
{
pp->pos.X += dx;
pp->pos.Y += dy;
pp->oposx = pp->oldposx = pp->pos.X;
pp->opos.X = pp->oldposx = pp->pos.X;
pp->oposy = pp->oldposy = pp->pos.Y;
break;
}

View file

@ -152,7 +152,7 @@ struct SWPlayer native
*/
// interpolation
//int oposx, oposy, oposz;
//int oposy, oposz;
// holds last valid move position
//int16 lv_sectnum;