From b667e44bcf9a62b109e3128617ac903945ed6c9c Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 3 Sep 2021 17:13:03 -0700 Subject: [PATCH] Don't use `map.extrarow` for menu animations This fixes all the headaches about map.extrarow having to be the correct value and which way it should be and whatnot. The latest headache was the detection that prevent user-initiated menu animations while an animation was already happening being tripped because graphics.menuoffset would be 230 (due to closing the menu while being in a room without a room name), but then going to a room with a room name would check for 240 instead, and 230 is less than 240. (The numbers are the wrong way round because I got the ternaries the wrong way round, but even if the numbers are the correct way round, the bug would still happen, but it would just be reversed.) So instead, I've just made it 240 for both. This doesn't change the duration of the menu animation (because the animation moves in increments of 25, and 230 / 25 == 240 / 25 under integer division). It might change the animation slightly, but it was already inconsistent anyway because map.extrarow was always set to be 1 in custom levels, and I legitimately would not be able to tell the difference without recording the animations and nitpicking it frame-by-frame. Fixes #841. --- desktop_version/src/Game.cpp | 2 +- desktop_version/src/RenderFixed.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index b63d59c9..306b42ba 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -6896,7 +6896,7 @@ void Game::mapmenuchange(const int newgamestate, const bool user_initiated) { if (user_initiated && graphics.menuoffset > 0 - && graphics.menuoffset < (map.extrarow ? 230 : 240)) + && graphics.menuoffset < 240) { return; } diff --git a/desktop_version/src/RenderFixed.cpp b/desktop_version/src/RenderFixed.cpp index 9c23c203..95a7e5f7 100644 --- a/desktop_version/src/RenderFixed.cpp +++ b/desktop_version/src/RenderFixed.cpp @@ -205,7 +205,7 @@ void maprenderfixed(void) || !script.running) { graphics.menuoffset += 25; - int threshold = map.extrarow ? 230 : 240; + int threshold = 240; if (graphics.menuoffset >= threshold) { graphics.menuoffset = threshold;