TOLTECS: Don't allow dialog skipping while movies are playing

This commit is contained in:
Torbjörn Andersson 2013-01-02 22:18:09 +01:00
parent 6a8fc83f42
commit ad36fb3366
3 changed files with 8 additions and 2 deletions

View File

@ -45,7 +45,7 @@ enum ChunkTypes {
kChunkStopSubtitles = 8
};
MoviePlayer::MoviePlayer(ToltecsEngine *vm) : _vm(vm) {
MoviePlayer::MoviePlayer(ToltecsEngine *vm) : _vm(vm), _isPlaying(false) {
}
MoviePlayer::~MoviePlayer() {
@ -62,6 +62,7 @@ void MoviePlayer::playMovie(uint resIndex) {
int16 savedGuiHeight = _vm->_guiHeight;
byte moviePalette[768];
_isPlaying = true;
_vm->_isSaveAllowed = false;
memset(moviePalette, 0, sizeof(moviePalette));
@ -200,6 +201,7 @@ void MoviePlayer::playMovie(uint resIndex) {
_vm->_guiHeight = savedGuiHeight;
_vm->_isSaveAllowed = true;
_isPlaying = false;
}
void MoviePlayer::fetchAudioChunks() {

View File

@ -37,11 +37,15 @@ public:
void playMovie(uint resIndex);
bool isPlaying() { return _isPlaying; }
protected:
ToltecsEngine *_vm;
Audio::QueuingAudioStream *_audioStream;
Audio::SoundHandle _audioStreamHandle;
bool _isPlaying;
uint32 _chunkCount, _frameCount, _lastPrefetchOfs;
uint32 _soundChunkFramesLeft, _framesPerSoundChunk;

View File

@ -340,7 +340,7 @@ void ToltecsEngine::updateInput() {
break;
case Common::KEYCODE_SPACE:
// Skip current dialog line, if a dialog is active
if (_screen->getTalkTextDuration() > 0) {
if (!_moviePlayer->isPlaying() && _screen->getTalkTextDuration() > 0) {
_sound->stopSpeech();
_screen->finishTalkTextItems();
_keyState.reset(); // event consumed