aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs
diff options
context:
space:
mode:
authorTorbjörn Andersson2013-01-04 02:27:56 +0100
committerTorbjörn Andersson2013-01-04 02:27:56 +0100
commitf93facaf45ba4eedb9f443c18c90892e06d9889b (patch)
treebcfbbc9f10e071f42d1a8b3ce23e91aeccbd1b1f /engines/toltecs
parente0b75c59ea62e309f537f1000f9289ef91b40d22 (diff)
downloadscummvm-rg350-f93facaf45ba4eedb9f443c18c90892e06d9889b.tar.gz
scummvm-rg350-f93facaf45ba4eedb9f443c18c90892e06d9889b.tar.bz2
scummvm-rg350-f93facaf45ba4eedb9f443c18c90892e06d9889b.zip
TOLTECS: Make aborting movies more reliable
Before, the main updateInput() might swallow attempts at aborting movies. Now all events are handled by the movie player's own handleInput(). As a side effect, it's no longer necessary to check if a movie is playing before removing subtitles when pressing space.
Diffstat (limited to 'engines/toltecs')
-rw-r--r--engines/toltecs/movie.cpp12
-rw-r--r--engines/toltecs/toltecs.cpp2
2 files changed, 10 insertions, 4 deletions
diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp
index 576890f703..45711ad983 100644
--- a/engines/toltecs/movie.cpp
+++ b/engines/toltecs/movie.cpp
@@ -100,8 +100,9 @@ void MoviePlayer::playMovie(uint resIndex) {
byte *chunkBuffer = NULL;
uint32 chunkBufferSize = 0;
uint32 frame = 0;
+ bool abortMovie = false;
- while (_chunkCount--) {
+ while (_chunkCount-- && !abortMovie) {
byte chunkType = _vm->_arc->readByte();
uint32 chunkSize = _vm->_arc->readUint32LE();
@@ -137,7 +138,8 @@ void MoviePlayer::playMovie(uint resIndex) {
if (_vm->_screen->_shakeActive && _vm->_screen->updateShakeScreen()) {
_vm->_screen->_fullRefresh = true;
}
- _vm->updateInput();
+ if (!handleInput())
+ abortMovie = true;
_vm->drawScreen();
// Note: drawScreen() calls delayMillis()
}
@@ -181,7 +183,7 @@ void MoviePlayer::playMovie(uint resIndex) {
}
if (!handleInput())
- break;
+ abortMovie = true;
}
delete[] chunkBuffer;
@@ -274,6 +276,10 @@ bool MoviePlayer::handleInput() {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
return false;
+ if (event.kbd.keycode == Common::KEYCODE_F10) {
+ // TODO: The original would bring up a stripped down
+ // main menu dialog, without the save/restore options.
+ }
break;
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_RBUTTONDOWN:
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 0e71bd88f9..f6a2dfed9d 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -340,7 +340,7 @@ void ToltecsEngine::updateInput() {
break;
case Common::KEYCODE_SPACE:
// Skip current dialog line, if a dialog is active
- if (!_moviePlayer->isPlaying() && _screen->getTalkTextDuration() > 0) {
+ if (_screen->getTalkTextDuration() > 0) {
_sound->stopSpeech();
_screen->finishTalkTextItems();
_keyState.reset(); // event consumed