SW: Use the old interpolation path in drawscreen if player is dead

This commit is contained in:
NY00123 2020-04-11 11:26:06 +03:00 committed by Christoph Oelckers
parent 120abb1029
commit 2d73466425
4 changed files with 23 additions and 8 deletions

View file

@ -2011,8 +2011,18 @@ drawscreen(PLAYERp pp)
tx = camerapp->oposx + mulscale16(camerapp->posx - camerapp->oposx, smoothratio); tx = camerapp->oposx + mulscale16(camerapp->posx - camerapp->oposx, smoothratio);
ty = camerapp->oposy + mulscale16(camerapp->posy - camerapp->oposy, smoothratio); ty = camerapp->oposy + mulscale16(camerapp->posy - camerapp->oposy, smoothratio);
tz = camerapp->oposz + mulscale16(camerapp->posz - camerapp->oposz, smoothratio); tz = camerapp->oposz + mulscale16(camerapp->posz - camerapp->oposz, smoothratio);
if (!TEST(pp->Flags, PF_DEAD))
{
tq16ang = camerapp->q16ang; tq16ang = camerapp->q16ang;
tq16horiz = camerapp->q16horiz; tq16horiz = camerapp->q16horiz;
}
else
{
tq16ang = camerapp->oq16ang + mulscale16(((camerapp->q16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio);
tq16horiz = camerapp->oq16horiz + mulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio);
}
tsectnum = camerapp->cursectnum; tsectnum = camerapp->cursectnum;
//ASSERT(tsectnum >= 0 && tsectnum <= MAXSECTORS); //ASSERT(tsectnum >= 0 && tsectnum <= MAXSECTORS);

View file

@ -1092,6 +1092,7 @@ struct PLAYERstruct
// interpolation // interpolation
int int
oposx, oposy, oposz; oposx, oposy, oposz;
fix16_t oq16horiz, oq16ang;
// Map follow mode pos values. // Map follow mode pos values.
int32_t mfposx, mfposy; int32_t mfposx, mfposy;

View file

@ -1351,7 +1351,7 @@ DoPlayerTeleportPause(PLAYERp pp)
void void
DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp) DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp)
{ {
pp->q16ang = fix16_from_int(sp->ang); pp->q16ang = pp->oq16ang = fix16_from_int(sp->ang);
pp->posx = pp->oposx = pp->oldposx = sp->x; pp->posx = pp->oposx = pp->oldposx = sp->x;
pp->posy = pp->oposy = pp->oldposy = sp->y; pp->posy = pp->oposy = pp->oldposy = sp->y;
@ -5643,9 +5643,9 @@ DoPlayerStopOperate(PLAYERp pp)
if (pp->sop_remote) if (pp->sop_remote)
{ {
if (TEST_BOOL1(pp->remote_sprite)) if (TEST_BOOL1(pp->remote_sprite))
pp->q16ang = fix16_from_int(pp->remote_sprite->ang); pp->q16ang = pp->oq16ang = fix16_from_int(pp->remote_sprite->ang);
else else
pp->q16ang = fix16_from_int(getangle(pp->sop_remote->xmid - pp->posx, pp->sop_remote->ymid - pp->posy)); pp->q16ang = pp->oq16ang = fix16_from_int(getangle(pp->sop_remote->xmid - pp->posx, pp->sop_remote->ymid - pp->posy));
} }
if (pp->sop_control) if (pp->sop_control)
@ -7067,6 +7067,8 @@ MoveSkipSavePos(void)
pp->oposx = pp->posx; pp->oposx = pp->posx;
pp->oposy = pp->posy; pp->oposy = pp->posy;
pp->oposz = pp->posz; pp->oposz = pp->posz;
pp->oq16ang = pp->q16ang;
pp->oq16horiz = pp->q16horiz;
} }
// save off stats for skip4 // save off stats for skip4
@ -7613,8 +7615,8 @@ InitAllPlayers(void)
pp->posx = pp->oposx = pfirst->posx; pp->posx = pp->oposx = pfirst->posx;
pp->posy = pp->oposy = pfirst->posy; pp->posy = pp->oposy = pfirst->posy;
pp->posz = pp->oposz = pfirst->posz; pp->posz = pp->oposz = pfirst->posz;
pp->q16ang = pfirst->q16ang; pp->q16ang = pp->oq16ang = pfirst->q16ang;
pp->q16horiz = pfirst->q16horiz; pp->q16horiz = pp->oq16horiz = pfirst->q16horiz;
pp->cursectnum = pfirst->cursectnum; pp->cursectnum = pfirst->cursectnum;
// set like this so that player can trigger something on start of the level // set like this so that player can trigger something on start of the level
pp->lastcursectnum = pfirst->cursectnum+1; pp->lastcursectnum = pfirst->cursectnum+1;
@ -7764,7 +7766,7 @@ PlayerSpawnPosition(PLAYERp pp)
pp->posx = pp->oposx = sp->x; pp->posx = pp->oposx = sp->x;
pp->posy = pp->oposy = sp->y; pp->posy = pp->oposy = sp->y;
pp->posz = pp->oposz = sp->z; pp->posz = pp->oposz = sp->z;
pp->q16ang = fix16_from_int(sp->ang); pp->q16ang = pp->oq16ang = fix16_from_int(sp->ang);
pp->cursectnum = sp->sectnum; pp->cursectnum = sp->sectnum;
getzsofslope(pp->cursectnum, pp->posx, pp->posy, &cz, &fz); getzsofslope(pp->cursectnum, pp->posx, pp->posy, &cz, &fz);

View file

@ -157,9 +157,11 @@ DoPrediction(PLAYERp ppp)
u = User[ppp->PlayerSprite]; u = User[ppp->PlayerSprite];
User[ppp->PlayerSprite] = &PredictUser; User[ppp->PlayerSprite] = &PredictUser;
ppp->oq16ang = ppp->q16ang;
ppp->oposx = ppp->posx; ppp->oposx = ppp->posx;
ppp->oposy = ppp->posy; ppp->oposy = ppp->posy;
ppp->oposz = ppp->posz; ppp->oposz = ppp->posz;
ppp->oq16horiz = ppp->q16horiz;
#if PREDICT_DEBUG #if PREDICT_DEBUG
PredictDebug(ppp); PredictDebug(ppp);