diff options
author | Eugene Sandulenko | 2019-11-06 15:03:54 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-13 22:07:08 +0100 |
commit | 4d97f9c65426185f362ebdb0918fd857548c46f8 (patch) | |
tree | b9256ffc7e4efc56983a93fc8b9057bda598f0e3 /engines/griffon | |
parent | 16386016efa08fa77fbcd40d29184eb23f61b1b0 (diff) | |
download | scummvm-rg350-4d97f9c65426185f362ebdb0918fd857548c46f8.tar.gz scummvm-rg350-4d97f9c65426185f362ebdb0918fd857548c46f8.tar.bz2 scummvm-rg350-4d97f9c65426185f362ebdb0918fd857548c46f8.zip |
GRIFFON: Optimized even handling in cutscenes
Diffstat (limited to 'engines/griffon')
-rw-r--r-- | engines/griffon/cutscenes.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/engines/griffon/cutscenes.cpp b/engines/griffon/cutscenes.cpp index 8e67eb6e63..1be04338d6 100644 --- a/engines/griffon/cutscenes.cpp +++ b/engines/griffon/cutscenes.cpp @@ -143,10 +143,10 @@ void GriffonEngine::showLogos() { g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h); g_system->updateScreen(); - g_system->getEventManager()->pollEvent(_event); - - if (_event.type == Common::EVENT_QUIT) - _shouldQuit = true; + if (g_system->getEventManager()->pollEvent(_event)) { + if (_event.type == Common::EVENT_QUIT) + _shouldQuit = true; + } _ticksPassed = _ticks; _ticks = g_system->getMillis(); @@ -253,15 +253,16 @@ void GriffonEngine::intro() { if (xofs >= 320) xofs -= 320; - g_system->getEventManager()->pollEvent(_event); + if (g_system->getEventManager()->pollEvent(_event)) { - if (_event.type == Common::EVENT_KEYDOWN) - cnt = 6; - if (_event.kbd.keycode == Common::KEYCODE_ESCAPE) - return; + if (_event.type == Common::EVENT_KEYDOWN) + cnt = 6; + if (_event.kbd.keycode == Common::KEYCODE_ESCAPE) + return; - if (_event.type == Common::EVENT_QUIT) - _shouldQuit = true; + if (_event.type == Common::EVENT_QUIT) + _shouldQuit = true; + } g_system->delayMillis(10); } while (!_shouldQuit); @@ -369,10 +370,6 @@ void GriffonEngine::endOfGame() { _videoBuffer->setAlpha(ya); g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h); - g_system->updateScreen(); - - g_system->getEventManager()->pollEvent(_event); - g_system->delayMillis(10); _ticksPassed = _ticks; _ticks = g_system->getMillis(); @@ -394,13 +391,18 @@ void GriffonEngine::endOfGame() { if (xofs >= 320) xofs -= 320; - if (_event.type == Common::EVENT_KEYDOWN) - spd = 1.0f; - if (_event.type == Common::EVENT_KEYUP) - spd = 0.2f; + if (g_system->getEventManager()->pollEvent(_event)) { + if (_event.type == Common::EVENT_KEYDOWN) + spd = 1.0f; + if (_event.type == Common::EVENT_KEYUP) + spd = 0.2f; - if (_event.kbd.keycode == Common::KEYCODE_ESCAPE) - break; + if (_event.kbd.keycode == Common::KEYCODE_ESCAPE) + break; + } + + g_system->updateScreen(); + g_system->delayMillis(10); } while (1); @@ -477,10 +479,10 @@ void GriffonEngine::endOfGame() { _fp = 0; } - g_system->getEventManager()->pollEvent(_event); - - if (_event.type == Common::EVENT_KEYDOWN && keywait < _ticks) - break; + if (g_system->getEventManager()->pollEvent(_event)) { + if (_event.type == Common::EVENT_KEYDOWN && keywait < _ticks) + break; + } } while (1); @@ -488,7 +490,6 @@ void GriffonEngine::endOfGame() { _videoBuffer3->fillRect(Common::Rect(0, 0, _videoBuffer3->w, _videoBuffer3->h), 0); theEnd(); - } void GriffonEngine::theEnd() { |