Interpolation fixes for SW:

draw.cpp: Fix the lack of interpolation while walking on a sector
object, like the bus roof or the floor of the train in Seppuku Station.
track.cpp: Make sure the player's location and angle aren't mistakenly
interpolated while standing on a moving sector object as a consequence.

# Conflicts:
#	source/sw/src/track.cpp
This commit is contained in:
NY00123 2020-04-13 22:47:19 +03:00 committed by Christoph Oelckers
parent 43ec16eb55
commit ac8a7ecfbd
2 changed files with 11 additions and 5 deletions

View File

@ -2052,11 +2052,14 @@ drawscreen(PLAYERp pp)
// ASSERT(tsectnum >= 0 && tsectnum <= MAXSECTORS);
if (pp->sop_riding || pp->sop_control)
{
if (pp->sop_control)
{
tx = pp->posx;
ty = pp->posy;
tz = pp->posz;
tq16ang = pp->q16ang;
}
tsectnum = pp->cursectnum;
updatesectorz(tx, ty, tz, &tsectnum);
}

View File

@ -1630,6 +1630,8 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
pp->posx += BOUND_4PIX(nx);
pp->posy += BOUND_4PIX(ny);
pp->oposx = pp->posx;
pp->oposy = pp->posy;
if (TEST(sop->flags, SOBJ_DONT_ROTATE))
{
@ -1674,7 +1676,7 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// New angle is formed by taking last known angle and
// adjusting by the delta angle
pp->q16ang = fix16_sadd(pp->RevolveAng, pp->RevolveDeltaAng) & 0x7FFFFFF;
pp->oq16ang = pp->q16ang = fix16_sadd(pp->RevolveAng, pp->RevolveDeltaAng) & 0x7FFFFFF;
UpdatePlayerSprite(pp);
}
@ -1927,6 +1929,7 @@ PlayerPart:
pp->SpriteP->z = pp->loz;
}
}
pp->oposz = pp->posz;
}
else
{