From 837ccfc7352a52db01b928b383deafe393e24442 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 28 Apr 2020 21:17:16 -0700 Subject: [PATCH] Move gravity line color updating to gamelogic() So it doesn't keep updating really quickly. --- desktop_version/src/Graphics.cpp | 12 ------------ desktop_version/src/Logic.cpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 17fc6c20..32f3d7de 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1447,18 +1447,6 @@ void Graphics::drawtrophytext() void Graphics::drawentities() { - //Update line colours! - if (linedelay <= 0) - { - linestate++; - if (linestate >= 10) linestate = 0; - linedelay = 2; - } - else - { - linedelay--; - } - point tpoint; SDL_Rect drawRect; diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 5f32c6ea..89c68e11 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1530,4 +1530,19 @@ void gamelogic() { graphics.updatebackground(map.background); } + + if (!game.blackout) + { + //Update line colours! + if (graphics.linedelay <= 0) + { + graphics.linestate++; + if (graphics.linestate >= 10) graphics.linestate = 0; + graphics.linedelay = 2; + } + else + { + graphics.linedelay--; + } + } }