From 0487d4d8d36c0eb882ed91f74179229f8a29c574 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 1 May 2009 11:48:42 +0200 Subject: Make sure mouse still moves smoothly during login By only limiting redraws when no SDL events were handled. --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index a18a370c..6721b8f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -974,9 +974,13 @@ int main(int argc, char *argv[]) while (state != STATE_EXIT) { + bool handledEvents = false; + // Handle SDL events while (SDL_PollEvent(&event)) { + handledEvents = true; + switch (event.type) { case SDL_QUIT: @@ -1538,7 +1542,8 @@ int main(int argc, char *argv[]) * just constantly redrawing the wallpaper. Added the following * usleep to limit it to 40 FPS during the login sequence */ - usleep(25000); + if (!handledEvents) + usleep(25000); } delete guiPalette; -- cgit v1.2.3-60-g2f50