- SW: Replace PLAYERstruct oposy with opos.Y calls.

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

View file

@ -825,7 +825,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie
PLAYERp pp = tu->PlayerP; PLAYERp pp = tu->PlayerP;
int sr = 65536 - int(smoothratio); int sr = 65536 - int(smoothratio);
tsp->pos.X -= MulScale(pp->pos.X - pp->opos.X, 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.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->oposz, sr, 16);
tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16); tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16);
} }
@ -1459,7 +1459,7 @@ void drawscreen(PLAYERp pp, double smoothratio)
camerapp = pp; camerapp = pp;
tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr); tx = interpolatedvalue(camerapp->opos.X, camerapp->pos.X, sr);
ty = interpolatedvalue(camerapp->oposy, camerapp->pos.Y, sr); ty = interpolatedvalue(camerapp->opos.Y, camerapp->pos.Y, sr);
tz = interpolatedvalue(camerapp->oposz, camerapp->pos.Z, sr); tz = interpolatedvalue(camerapp->oposz, camerapp->pos.Z, sr);
// Interpolate the player's angle while on a sector object, just like VoidSW. // Interpolate the player's angle while on a sector object, just like VoidSW.

View file

@ -677,7 +677,7 @@ struct PLAYERstruct
} }
// interpolation // interpolation
int oposy, oposz; int oposz;
// holds last valid move position // holds last valid move position
int lv_x,lv_y,lv_z; 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 // If player is dead still then update at MoveSkip4
// rate. // rate.
if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->oposy && pp->pos.Z == pp->oposz) if (pp->pos.X == pp->opos.X && pp->pos.Y == pp->opos.Y && pp->pos.Z == pp->oposz)
DoCam = true; DoCam = true;

View file

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

View file

@ -1281,7 +1281,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang)
{ {
pp->angle.ang = pp->angle.oang = buildang(ang); pp->angle.ang = pp->angle.oang = buildang(ang);
pp->pos.X = pp->opos.X = pp->oldposx = sp->X; pp->pos.X = pp->opos.X = pp->oldposx = sp->X;
pp->pos.Y = pp->oposy = pp->oldposy = sp->Y; pp->pos.Y = pp->opos.Y = pp->oldposy = sp->Y;
//getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz); //getzsofslopeptr(sp->sector(), pp->posx, pp->posy, &cz, &fz);
//pp->posz = pp->oposz = fz - PLAYER_HEIGHT; //pp->posz = pp->oposz = fz - PLAYER_HEIGHT;
@ -1295,7 +1295,7 @@ void DoPlayerTeleportToSprite(PLAYERp pp, vec3_t* sp, int ang)
void DoPlayerTeleportToOffset(PLAYERp pp) void DoPlayerTeleportToOffset(PLAYERp pp)
{ {
pp->opos.X = pp->oldposx = pp->pos.X; pp->opos.X = pp->oldposx = pp->pos.X;
pp->oposy = pp->oldposy = pp->pos.Y; pp->opos.Y = pp->oldposy = pp->pos.Y;
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
SET(pp->Flags2, PF2_TELEPORTED); SET(pp->Flags2, PF2_TELEPORTED);
@ -2082,7 +2082,7 @@ void DoPlayerMove(PLAYERp pp)
if (interpolate_ride) if (interpolate_ride)
{ {
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
} }
pp->pos.X += pp->xvect >> 14; pp->pos.X += pp->xvect >> 14;
pp->pos.Y += pp->yvect >> 14; pp->pos.Y += pp->yvect >> 14;
@ -2109,7 +2109,7 @@ void DoPlayerMove(PLAYERp pp)
if (interpolate_ride) if (interpolate_ride)
{ {
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
} }
auto save_cstat = sp->cstat; auto save_cstat = sp->cstat;
@ -3604,7 +3604,7 @@ void PlayerWarpUpdatePos(PLAYERp pp)
return; return;
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
pp->oposz = pp->pos.Z; pp->oposz = pp->pos.Z;
DoPlayerZrange(pp); DoPlayerZrange(pp);
UpdatePlayerSprite(pp); UpdatePlayerSprite(pp);
@ -4120,7 +4120,7 @@ void DoPlayerWarpToUnderwater(PLAYERp pp)
pp->pos.Z = under_sp->sector()->ceilingz + Z(6); pp->pos.Z = under_sp->sector()->ceilingz + Z(6);
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
pp->oposz = pp->pos.Z; pp->oposz = pp->pos.Z;
DoPlayerZrange(pp); DoPlayerZrange(pp);
@ -4198,7 +4198,7 @@ void DoPlayerWarpToSurface(PLAYERp pp)
pp->pos.Z -= Z(pp->WadeDepth); pp->pos.Z -= Z(pp->WadeDepth);
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
pp->oposz = pp->pos.Z; pp->oposz = pp->pos.Z;
return; return;
@ -6486,7 +6486,7 @@ void MoveSkipSavePos(void)
pp = Player + pnum; pp = Player + pnum;
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->oposy = pp->pos.Y; pp->opos.Y = pp->pos.Y;
pp->oposz = pp->pos.Z; pp->oposz = pp->pos.Z;
pp->obob_z = pp->bob_z; pp->obob_z = pp->bob_z;
pp->angle.backup(); pp->angle.backup();
@ -6826,7 +6826,7 @@ void InitAllPlayers(void)
for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++) for (pp = Player; pp < &Player[MAX_SW_PLAYERS]; pp++)
{ {
pp->pos.X = pp->opos.X = pfirst->pos.X; pp->pos.X = pp->opos.X = pfirst->pos.X;
pp->pos.Y = pp->oposy = pfirst->pos.Y; pp->pos.Y = pp->opos.Y = pfirst->pos.Y;
pp->pos.Z = pp->oposz = pfirst->pos.Z; pp->pos.Z = pp->oposz = pfirst->pos.Z;
pp->angle.ang = pp->angle.oang = pfirst->angle.ang; pp->angle.ang = pp->angle.oang = pfirst->angle.ang;
pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz; pp->horizon.horiz = pp->horizon.ohoriz = pfirst->horizon.horiz;
@ -6983,7 +6983,7 @@ void PlayerSpawnPosition(PLAYERp pp)
pp->pos.X = pp->opos.X = sp->pos.X; pp->pos.X = pp->opos.X = sp->pos.X;
pp->pos.Y = pp->oposy = sp->pos.Y; pp->pos.Y = pp->opos.Y = sp->pos.Y;
pp->pos.Z = pp->oposz = sp->pos.Z; pp->pos.Z = pp->oposz = sp->pos.Z;
pp->angle.ang = pp->angle.oang = buildang(sp->ang); pp->angle.ang = pp->angle.oang = buildang(sp->ang);
pp->setcursector(sp->sector()); pp->setcursector(sp->sector());

View file

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

View file

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

View file

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