From b4142976f22304c17aef38ad8d8d1dc4cc1d156d Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 29 Apr 2020 17:09:51 -0700 Subject: [PATCH] Move crewframedelay to titlelogic() and maplogic() Incidentally enough, this de-duplicates the amount of times this code has been copy-pasted from 4 times to 2. Anyways, this makes it so the crew don't go lightning fast on the summary screen, the NDM game-over screen, the NDM win screen, and the pause screen in the main game. It was slightly hilarious seeing them go really quickly, actually. It was like they were running away from a giant monster or something. --- desktop_version/src/Logic.cpp | 14 ++++++++++++++ desktop_version/src/Render.cpp | 25 ------------------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index ee5da48e..b9092173 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -17,6 +17,13 @@ void titlelogic() graphics.updatetowerbackground(); } + graphics.crewframedelay--; + if (graphics.crewframedelay <= 0) + { + graphics.crewframedelay = 8; + graphics.crewframe = (graphics.crewframe + 1) % 2; + } + if (game.menucountdown > 0) { game.menucountdown--; @@ -45,6 +52,13 @@ void maplogic() help.updateglow(); graphics.updatetextboxes(); + graphics.crewframedelay--; + if (graphics.crewframedelay <= 0) + { + graphics.crewframedelay = 8; + graphics.crewframe = (graphics.crewframe + 1) % 2; + } + graphics.oldmenuoffset = graphics.menuoffset; if (graphics.resumegamemode) { diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 808b7cd3..881e66c8 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -504,12 +504,6 @@ void menurender() graphics.Print( -1, 75, "Are you sure you want to quit?", tr, tg, tb, true); break; case Menu::continuemenu: - graphics.crewframedelay--; - if (graphics.crewframedelay <= 0) - { - graphics.crewframedelay = 8; - graphics.crewframe = (graphics.crewframe + 1) % 2; - } switch (game.currentmenuoption) { case 0: @@ -551,12 +545,6 @@ void menurender() { graphics.bigprint( -1, 25, "GAME OVER", tr, tg, tb, true, 3); - graphics.crewframedelay--; - if (graphics.crewframedelay <= 0) - { - graphics.crewframedelay = 8; - graphics.crewframe = (graphics.crewframe + 1) % 2; - } for (int i = 0; i < 6; i++) { graphics.drawcrewman(169-(3*42)+(i*42), 68, i, game.crewstats[i], true); @@ -602,12 +590,6 @@ void menurender() { graphics.bigprint( -1, 8, "WOW", tr, tg, tb, true, 4); - graphics.crewframedelay--; - if (graphics.crewframedelay <= 0) - { - graphics.crewframedelay = 8; - graphics.crewframe = (graphics.crewframe + 1) % 2; - } for (int i = 0; i < 6; i++) { graphics.drawcrewman(169-(3*42)+(i*42), 68, i, game.crewstats[i], true); @@ -1684,13 +1666,6 @@ void maprender() //Background color FillRect(graphics.backBuffer,0, 12, 320, 240, 10, 24, 26 ); - graphics.crewframedelay--; - if (graphics.crewframedelay <= 0) - { - graphics.crewframedelay = 8; - graphics.crewframe = (graphics.crewframe + 1) % 2; - } - //Menubar: