From ac8a7ecfbdfbe9152a8ead605723c1d18eca7798 Mon Sep 17 00:00:00 2001 From: NY00123 Date: Mon, 13 Apr 2020 22:47:19 +0300 Subject: [PATCH] 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 --- source/sw/src/draw.cpp | 11 +++++++---- source/sw/src/track.cpp | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index f993f6164..9d693d2cd 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -2053,10 +2053,13 @@ drawscreen(PLAYERp pp) if (pp->sop_riding || pp->sop_control) { - tx = pp->posx; - ty = pp->posy; - tz = pp->posz; - tq16ang = pp->q16ang; + if (pp->sop_control) + { + tx = pp->posx; + ty = pp->posy; + tz = pp->posz; + tq16ang = pp->q16ang; + } tsectnum = pp->cursectnum; updatesectorz(tx, ty, tz, &tsectnum); } diff --git a/source/sw/src/track.cpp b/source/sw/src/track.cpp index e626e9c47..90a67be18 100644 --- a/source/sw/src/track.cpp +++ b/source/sw/src/track.cpp @@ -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 {