summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-01 11:48:42 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-01 11:48:42 +0200
commit0487d4d8d36c0eb882ed91f74179229f8a29c574 (patch)
tree280ef1ab8f7d05fc06103ad927bf61ee767f5857 /src/main.cpp
parentf016894763970ad5601d1fb2de10431fb876ff53 (diff)
downloadMana-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.gz
Mana-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.bz2
Mana-0487d4d8d36c0eb882ed91f74179229f8a29c574.tar.xz
Mana-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.cpp7
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;