1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01:00

Fix H/V warp BG not resetting when returning to editor (again)

This is because due to the game loop changes in this over-30-FPS patch,
editorrender() can be called and undo graphics.backgrounddrawn being set
to false once again. Solution here is to make it so it keeps being set
to false until game.shouldreturntoeditor is turned off, which has also
been moved to editorlogic().
This commit is contained in:
Misa 2020-05-09 14:44:51 -07:00 committed by Ethan Lee
parent 057bdc9b68
commit 2f447fd794
2 changed files with 10 additions and 1 deletions

View file

@ -1595,7 +1595,6 @@ void gamelogic()
#if !defined(NO_CUSTOM_LEVELS) #if !defined(NO_CUSTOM_LEVELS)
if (game.shouldreturntoeditor) if (game.shouldreturntoeditor)
{ {
game.shouldreturntoeditor = false;
game.returntoeditor(); game.returntoeditor();
} }
#endif #endif

View file

@ -2463,6 +2463,11 @@ void editormenurender(int tr, int tg, int tb)
void editorrender() void editorrender()
{ {
if (game.shouldreturntoeditor)
{
graphics.backgrounddrawn = false;
}
//Draw grid //Draw grid
FillRect(graphics.backBuffer, 0, 0, 320,240, graphics.getRGB(0,0,0)); FillRect(graphics.backBuffer, 0, 0, 320,240, graphics.getRGB(0,0,0));
@ -3599,6 +3604,11 @@ void editorlogic()
graphics.setcol(ed.entcol); graphics.setcol(ed.entcol);
ed.entcolreal = graphics.ct.colour; ed.entcolreal = graphics.ct.colour;
if (game.shouldreturntoeditor)
{
game.shouldreturntoeditor = false;
}
map.bypos -= 2; map.bypos -= 2;
map.bscroll = -2; map.bscroll = -2;