mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
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.
This commit is contained in:
parent
727400ff27
commit
da6c524db5
2 changed files with 2 additions and 2 deletions
|
@ -6865,7 +6865,7 @@ void Game::mapmenuchange(const int newgamestate, const bool user_initiated)
|
||||||
{
|
{
|
||||||
if (user_initiated
|
if (user_initiated
|
||||||
&& graphics.menuoffset > 0
|
&& graphics.menuoffset > 0
|
||||||
&& graphics.menuoffset < (map.extrarow ? 230 : 240))
|
&& graphics.menuoffset < 240)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ void maprenderfixed(void)
|
||||||
|| !script.running)
|
|| !script.running)
|
||||||
{
|
{
|
||||||
graphics.menuoffset += 25;
|
graphics.menuoffset += 25;
|
||||||
int threshold = map.extrarow ? 230 : 240;
|
int threshold = 240;
|
||||||
if (graphics.menuoffset >= threshold)
|
if (graphics.menuoffset >= threshold)
|
||||||
{
|
{
|
||||||
graphics.menuoffset = threshold;
|
graphics.menuoffset = threshold;
|
||||||
|
|
Loading…
Reference in a new issue