From 2f447fd794df90ea76a02aa0d12709ff9a93f177 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 9 May 2020 14:44:51 -0700 Subject: [PATCH] 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(). --- desktop_version/src/Logic.cpp | 1 - desktop_version/src/editor.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 6dc7d7b8..4f31b194 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1595,7 +1595,6 @@ void gamelogic() #if !defined(NO_CUSTOM_LEVELS) if (game.shouldreturntoeditor) { - game.shouldreturntoeditor = false; game.returntoeditor(); } #endif diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 1299f44a..e3c1fb24 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2463,6 +2463,11 @@ void editormenurender(int tr, int tg, int tb) void editorrender() { + if (game.shouldreturntoeditor) + { + graphics.backgrounddrawn = false; + } + //Draw grid FillRect(graphics.backBuffer, 0, 0, 320,240, graphics.getRGB(0,0,0)); @@ -3599,6 +3604,11 @@ void editorlogic() graphics.setcol(ed.entcol); ed.entcolreal = graphics.ct.colour; + if (game.shouldreturntoeditor) + { + game.shouldreturntoeditor = false; + } + map.bypos -= 2; map.bscroll = -2;