summaryrefslogtreecommitdiffstats
path: root/src/app/app.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-23 21:41:27 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-23 21:41:27 +0200
commit9d592045317ca66be415e60ba4c2db90b5d7ad3e (patch)
tree921dd92c63b6260ea27d70eb7521e3a054d7f142 /src/app/app.cpp
parent8797569d33c4917eb8f8a1dc2341aac7b5815315 (diff)
downloadcolobot-9d592045317ca66be415e60ba4c2db90b5d7ad3e.tar.gz
colobot-9d592045317ca66be415e60ba4c2db90b5d7ad3e.tar.bz2
colobot-9d592045317ca66be415e60ba4c2db90b5d7ad3e.zip
Cursor drawing
- fixed cursor drawing in CEngine - changed event loop to generate more events
Diffstat (limited to 'src/app/app.cpp')
-rw-r--r--src/app/app.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp
index 4812102..e626695 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -457,27 +457,24 @@ int CApplication::Run()
while (true)
{
- // Use SDL_PeepEvents() if the app is active, so we can use idle time to
- // render the scene. Else, use SDL_PollEvent() to avoid eating CPU time.
- int count = 0;
-
// To be sure no old event remains
m_private->currentEvent.type = SDL_NOEVENT;
+ if (m_active)
+ SDL_PumpEvents();
+
bool haveEvent = true;
while (haveEvent)
{
haveEvent = false;
+ int count = 0;
+ // Use SDL_PeepEvents() if the app is active, so we can use idle time to
+ // render the scene. Else, use SDL_PollEvent() to avoid eating CPU time.
if (m_active)
- {
- SDL_PumpEvents();
count = SDL_PeepEvents(&m_private->currentEvent, 1, SDL_GETEVENT, SDL_ALLEVENTS);
- }
else
- {
count = SDL_PollEvent(&m_private->currentEvent);
- }
// If received an event
if (count > 0)