- SW: Promote recoil_horizoff to Q16.16 to avoid down-scaling only to upscale.

This commit is contained in:
Mitchell Richters 2020-09-07 21:34:13 +10:00
parent e36c9fc78c
commit 2e2ca03812
3 changed files with 3 additions and 3 deletions

View file

@ -1729,7 +1729,7 @@ drawscreen(PLAYERp pp, double smoothratio)
tz += pp->obob_z + xs_CRoundToInt(fmulscale16(pp->bob_z - pp->obob_z, smoothratio));
// recoil only when not in camera
tq16horiz = tq16horiz + IntToFixed(pp->recoil_horizoff);
tq16horiz = tq16horiz + pp->recoil_horizoff;
tq16horiz = max(tq16horiz, IntToFixed(PLAYER_HORIZ_MIN));
tq16horiz = min(tq16horiz, IntToFixed(PLAYER_HORIZ_MAX));
}

View file

@ -886,7 +886,7 @@ struct PLAYERstruct
short recoil_amt;
short recoil_speed;
short recoil_ndx;
short recoil_horizoff;
fixed_t recoil_horizoff;
int oldposx,oldposy,oldposz;
int RevolveX, RevolveY;

View file

@ -2012,7 +2012,7 @@ DoPlayerRecoil(PLAYERp pp)
}
// move pp->q16horiz up and down
pp->recoil_horizoff = ((pp->recoil_amt * sintable[pp->recoil_ndx]) >> 14);
pp->recoil_horizoff = (pp->recoil_amt * sintable[pp->recoil_ndx]) << 2;
}