From 5f2b9409b2b17dfb625cee055b40693c048c851c Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 19 Mar 2021 13:57:05 -0700 Subject: [PATCH] De-duplicate Gravitron initial message Since the only difference is the y-positions, I've decided to remove the copy-pasted code. A better solution would be to have a function that draws multiline text and handles it accordingly in Flip Mode, but that could be done later. --- desktop_version/src/Render.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index c5f4fcec..853a8a41 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1589,16 +1589,20 @@ void gamerender(void) { if (int(game.swndelay / 15) % 2 == 1 || game.swndelay >= 120) { + int y1; + int y2; if (graphics.flipmode) { - graphics.bigprint( -1, 30, "Survive for", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); - graphics.bigprint( -1, 10, "60 seconds!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + y1 = 30; + y2 = 10; } else { - graphics.bigprint( -1, 10, "Survive for", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); - graphics.bigprint( -1, 30, "60 seconds!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + y1 = 10; + y2 = 30; } + graphics.bigprint( -1, y1, "Survive for", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); + graphics.bigprint( -1, y2, "60 seconds!", 220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2), true, 2); } } else if(game.swngame==7)