From 701b33da0d620df0aff94ec8c7b0531ad95e3a18 Mon Sep 17 00:00:00 2001 From: NY00123 Date: Sat, 11 Apr 2020 11:03:37 +0300 Subject: [PATCH] SW: Make horiz centering a bit less immediate again --- source/sw/src/player.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index f1a3d665e..a035889a6 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1929,7 +1929,19 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz) if (TEST_SYNC_KEY(pp, SK_CENTER_VIEW)) { - *pq16horiz = pp->q16horizbase = fix16_from_int(100); + if (PEDANTIC_MODE) + pp->q16horizbase = fix16_from_int(100); + else if (pp->q16horizbase > fix16_from_int(100)) + { + pp->q16horizbase = fix16_ssub(pp->q16horizbase, fix16_from_float(scaleAdjustmentToInterval((HORIZ_SPEED*6)))); + pp->q16horizbase = fix16_max(pp->q16horizbase, fix16_from_int(100)); + } + else if (pp->q16horizbase < fix16_from_int(100)) + { + pp->q16horizbase = fix16_sadd(pp->q16horizbase, fix16_from_float(scaleAdjustmentToInterval((HORIZ_SPEED*6)))); + pp->q16horizbase = fix16_min(pp->q16horizbase, fix16_from_int(100)); + } + pp->camq16horiz = pp->q16horizbase; pp->q16horizoff = 0; }