1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 05:58:30 +02:00

Fix 1-frame glitch when going to in-game options from edsettings

The menu creation of Graphic Options or Game Options, as well as the
map.nexttowercolour() call, all need to be deferred until the end of the
frame.
This commit is contained in:
Misa 2021-03-18 21:14:40 -07:00 committed by Ethan Lee
parent 951679b1f8
commit 2d9d0cffa5

View File

@ -9,6 +9,7 @@
#include <tinyxml2.h>
#include <utf8/unchecked.h>
#include "DeferCallbacks.h"
#include "Entity.h"
#include "Enums.h"
#include "FileSystemUtils.h"
@ -3669,6 +3670,20 @@ void editorlogic(void)
}
}
static void creategraphicoptions(void)
{
game.createmenu(Menu::graphicoptions);
}
static void creategameoptions(void)
{
game.createmenu(Menu::options);
}
static void nextbgcolor(void)
{
map.nexttowercolour();
}
static void editormenuactionpress(void)
{
@ -3768,14 +3783,14 @@ static void editormenuactionpress(void)
if (game.currentmenuoption == 6)
{
game.createmenu(Menu::graphicoptions);
DEFER_CALLBACK(creategraphicoptions);
}
else
{
game.createmenu(Menu::options);
DEFER_CALLBACK(creategameoptions);
}
map.nexttowercolour();
DEFER_CALLBACK(nextbgcolor);
break;
default:
music.playef(11);