diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-01 11:48:42 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-01 11:48:42 +0200 |
commit | 0487d4d8d36c0eb882ed91f74179229f8a29c574 (patch) | |
tree | 280ef1ab8f7d05fc06103ad927bf61ee767f5857 /src/main.cpp | |
parent | f016894763970ad5601d1fb2de10431fb876ff53 (diff) | |
download | mana-client-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.gz mana-client-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.bz2 mana-client-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.xz mana-client-0487d4d8d36c0eb882ed91f74179229f8a29c574.zip |
Make sure mouse still moves smoothly during login
By only limiting redraws when no SDL events were handled.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; |