From 846c6f61d489bf7371959ea5884cd193af1191b1 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 11 Jul 2020 00:10:06 -0700 Subject: [PATCH] Use .clear() when removing text boxes in reset functions graphics.textbox.clear() should be used instead of graphics.textboxremove() or graphics.textboxremovefast(), because even with graphics.textboxremovefast(), you'll still have to process at least one frame of GAMEMODE logic before the text boxes are actually properly removed, and this caused a 1-frame glitch when exiting playtesting with text boxes on-screen and then re-entering playtesting. Technically I could've only fixed it in Game::returntoeditor(), but I wanted to be safe, so I also fixed it in scriptclass::hardreset(), too. --- desktop_version/src/Game.cpp | 2 +- desktop_version/src/Script.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index ea200a54..4c5a798f 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7298,7 +7298,7 @@ void Game::returntoeditor() { game.gamestate = EDITORMODE; - graphics.textboxremove(); + graphics.textbox.clear(); game.hascontrol = true; game.advancetext = false; game.completestop = false; diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 1e755fc7..15058bf6 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -3648,7 +3648,7 @@ void scriptclass::hardreset() //dwgraphicsclass graphics.backgrounddrawn = false; - graphics.textboxremovefast(); + graphics.textbox.clear(); graphics.flipmode = false; //This will be reset if needs be elsewhere graphics.showcutscenebars = false; graphics.cutscenebarspos = 0;