SW: This should hopefully be a better way of fixing the lack of

interpolation of player turning/aiming/movement, while being carried
by a sector object, without SO interpolation. This is a continuation of
73a0aa394e906a65633d61f3c749c9b9b7e66aaa and bf31bc2987a3eccd31d343622327bd4ee0f9c5a1,
aiming to fix a jitter in case the player is continuously
getting pushed by a wall (e.g., on the boat in level 5).

Basically, this moves the relevant assignments from track.cpp:MovePlayer
and MovePoints to player.cpp:DoPlayerMove. Unless a call to one of these
functions has been missed, pushwall and clipmove can be called from
player.cpp in the following instances, which should be covered:
- Via DoPlayerMove, which is the function getting the fix now.
- Via DoPlayerSlide, which is called in the beginning of DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerCrawl/DoPlayerWade,
followed by DoPlayerMove.
- Via DoPlayerCurrent when called from DoPlayerDive,
followed by DoPlayerMove if the player doesn't stop diving.

# Conflicts:
#	source/sw/src/track.cpp
This commit is contained in:
NY00123 2020-05-27 22:47:29 +03:00 committed by Christoph Oelckers
parent a0876223ab
commit ce2aee49df
2 changed files with 24 additions and 13 deletions

View file

@ -2650,6 +2650,13 @@ DoPlayerMove(PLAYERp pp)
int friction;
int save_cstat;
int push_ret = 0;
// If SO interpolation is disabled, make sure the player's aiming,
// turning and movement still get appropriately interpolated.
// We do this from here instead of MovePlayer, covering the case
// the player gets pushed by a wall (e.g., on the boat in level 5).
SWBOOL interpolate_ride = pp->sop_riding && (!gs.InterpolateSO || CommEnabled);
void SlipSlope(PLAYERp pp);
SlipSlope(pp);
@ -2704,6 +2711,11 @@ DoPlayerMove(PLAYERp pp)
if (TEST(pp->Flags, PF_CLIP_CHEAT))
{
short sectnum=pp->cursectnum;
if (interpolate_ride)
{
pp->oposx = pp->posx;
pp->oposy = pp->posy;
}
pp->posx += pp->xvect >> 14;
pp->posy += pp->yvect >> 14;
COVERupdatesector(pp->posx, pp->posy, &sectnum);
@ -2726,6 +2738,12 @@ DoPlayerMove(PLAYERp pp)
}
}
if (interpolate_ride)
{
pp->oposx = pp->posx;
pp->oposy = pp->posy;
}
save_cstat = pp->SpriteP->cstat;
RESET(pp->SpriteP->cstat, CSTAT_SPRITE_BLOCK);
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
@ -2748,6 +2766,12 @@ DoPlayerMove(PLAYERp pp)
}
}
if (interpolate_ride)
{
pp->oposz = pp->posz;
pp->oq16ang = pp->q16ang;
}
// check for warp - probably can remove from CeilingHit
if (WarpPlane(&pp->posx, &pp->posy, &pp->posz, &pp->cursectnum))
PlayerWarpUpdatePos(pp);

View file

@ -1636,11 +1636,6 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
if (TEST(sop->flags, SOBJ_DONT_ROTATE))
{
if (!cl_sointerpolation || CommEnabled)
{
pp->oposx = pp->posx;
pp->oposy = pp->posy;
}
UpdatePlayerSprite(pp);
return;
}
@ -1686,12 +1681,6 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
pp->camq16ang = NORM_Q16ANGLE(pp->camq16ang);
pp->q16ang = NORM_Q16ANGLE(pp->RevolveQ16Ang + fix16_from_int(pp->RevolveDeltaAng));
if (!cl_sointerpolation || CommEnabled)
{
pp->oq16ang = pp->q16ang;
pp->oposx = pp->posx;
pp->oposy = pp->posy;
}
UpdatePlayerSprite(pp);
}
@ -1946,8 +1935,6 @@ PlayerPart:
pp->SpriteP->z = pp->loz;
}
}
if (!cl_sointerpolation || CommEnabled)
pp->oposz = pp->posz;
}
else
{