From d7b7ed9a68940835725cbc6bcbf5a938c8cf74a4 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 25 Feb 2024 16:52:58 +0700 Subject: [PATCH] fix automap center after aspect ratio change (#1534) --- src/am_map.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index ce74d653..a0112639 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -604,11 +604,18 @@ static void AM_initScreenSize(void) void AM_ResetScreenSize(void) { - AM_saveScaleAndLoc(); + int old_h = f_h; AM_initScreenSize(); - AM_restoreScaleAndLoc(); + if (f_h != old_h) + { + // Change the scaling multipliers + scale_mtof = FixedDiv(f_w << FRACBITS, m_w); + scale_ftom = FixedDiv(FRACUNIT, scale_mtof); + } + + AM_activateNewScale(); } //