diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-23 21:41:27 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-23 21:41:27 +0200 |
commit | 9d592045317ca66be415e60ba4c2db90b5d7ad3e (patch) | |
tree | 921dd92c63b6260ea27d70eb7521e3a054d7f142 /src/app | |
parent | 8797569d33c4917eb8f8a1dc2341aac7b5815315 (diff) | |
download | colobot-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')
-rw-r--r-- | src/app/app.cpp | 15 |
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) |