From 51d3b66ab9e90a88e1c46aa1906d82605efde686 Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Tue, 21 Mar 2023 21:57:28 +0000 Subject: [PATCH] Added a frame limit to the start screen. This will stop excessive resource usage and random speeds. --- Spacewar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Spacewar.c b/Spacewar.c index 8a754d6..13344e0 100644 --- a/Spacewar.c +++ b/Spacewar.c @@ -168,7 +168,10 @@ int main(int argc, char ** argv) if(keyboardState[SDL_SCANCODE_RETURN] == 1) { inputSelected = true; - } + } + + // Delay enough so that we run at 30 frames in the menu: + SDL_Delay(1000 / 30); } } else @@ -247,6 +250,9 @@ int main(int argc, char ** argv) { inputSelected = true; } + + // Delay enough so that we run at 30 frames in the menu: + SDL_Delay(1000 / 30); } // Load joystick