diff options
author | Peter Bozsó | 2014-09-06 22:52:15 +0200 |
---|---|---|
committer | Peter Bozsó | 2014-09-06 22:52:24 +0200 |
commit | 5e099e90bcdfb87c289b919ddac60e60fbf6bdd7 (patch) | |
tree | ab62fdcb0d41e165d2e2d489b22ddc3b8f19c745 /engines | |
parent | a5528ecc7e7da65ae89bae9c9d2cabe6b4e99145 (diff) | |
download | scummvm-rg350-5e099e90bcdfb87c289b919ddac60e60fbf6bdd7.tar.gz scummvm-rg350-5e099e90bcdfb87c289b919ddac60e60fbf6bdd7.tar.bz2 scummvm-rg350-5e099e90bcdfb87c289b919ddac60e60fbf6bdd7.zip |
CGE2: Make the intro skippable.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2.cpp | 1 | ||||
-rw-r--r-- | engines/cge2/cge2.h | 1 | ||||
-rw-r--r-- | engines/cge2/cge2_main.cpp | 8 | ||||
-rw-r--r-- | engines/cge2/events.cpp | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index 8b51dda75e..8e70f0e93e 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -76,6 +76,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _vol[i] = nullptr; _eventManager = nullptr; _map = nullptr; + _skipIntro = false; _quitFlag = false; _bitmapPalette = nullptr; _startupMode = 1; diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 8e94683824..79cb2064c8 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -280,6 +280,7 @@ public: Common::RandomSource _randomSource; + bool _skipIntro; bool _quitFlag; Dac *_bitmapPalette; int _startupMode; diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index c52a354f9e..3a994dd0f5 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -396,7 +396,7 @@ void CGE2Engine::movie(const char *ext) { sceneUp(_now); _keyboard->setClient(_sys); - while (!_commandHandler->idle() && !_quitFlag) + while (!_commandHandler->idle() && !_quitFlag && !_skipIntro) mainLoop(); _keyboard->setClient(nullptr); @@ -532,11 +532,11 @@ void CGE2Engine::mainLoop() { // Handle a delay between game frames handleFrame(); - // Handle any pending events - _eventManager->poll(); - // Check shouldQuit() _quitFlag = shouldQuit(); + + // Handle any pending events + _eventManager->poll(); } void CGE2Engine::checkSounds() { diff --git a/engines/cge2/events.cpp b/engines/cge2/events.cpp index ed1ec66bb1..13f6b4dc5d 100644 --- a/engines/cge2/events.cpp +++ b/engines/cge2/events.cpp @@ -219,6 +219,8 @@ void EventManager::poll() { switch (_event.type) { case Common::EVENT_KEYDOWN: case Common::EVENT_KEYUP: + if (_vm->_startupMode == 1) + _vm->_skipIntro = true; // So the player can interrupt the intro. // Handle keyboard events _vm->_keyboard->newKeyboard(_event); handleEvents(); |