diff options
| author | Travis Howell | 2007-06-12 06:08:47 +0000 |
|---|---|---|
| committer | Travis Howell | 2007-06-12 06:08:47 +0000 |
| commit | 12c9fb03820c383d5d10fa3c3ba8e2cffad8db98 (patch) | |
| tree | 153e2ac588eae58913bf3c1b5ec30e41a7c80fef /engines/agos | |
| parent | 9c07235a938e668cf3b4728a11ec8161d7d67c6b (diff) | |
| download | scummvm-rg350-12c9fb03820c383d5d10fa3c3ba8e2cffad8db98.tar.gz scummvm-rg350-12c9fb03820c383d5d10fa3c3ba8e2cffad8db98.tar.bz2 scummvm-rg350-12c9fb03820c383d5d10fa3c3ba8e2cffad8db98.zip | |
Add support for pausing/resume cutscenes shown on the OmniTV in The Feeble Files.
svn-id: r27371
Diffstat (limited to 'engines/agos')
| -rw-r--r-- | engines/agos/animation.cpp | 45 | ||||
| -rw-r--r-- | engines/agos/animation.h | 3 |
2 files changed, 35 insertions, 13 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index a482f73c98..1cbf74549d 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -44,6 +44,8 @@ MoviePlayer::MoviePlayer(AGOSEngine *vm, Audio::Mixer *mixer) : DXAPlayer(), _vm(vm), _mixer(mixer) { _omniTV = false; + _omniTVFile = 0; + _leftButtonDown = false; _rightButtonDown = false; @@ -103,14 +105,21 @@ bool MoviePlayer::load(const char *filename) { void MoviePlayer::playOmniTV() { // Load OmniTV video - if (!_fd.isOpen()) { - _vm->_variableArray[254] = 6747; - return; - } else { + if (_fd) { _vm->setBitFlag(42, false); _omniTV = true; startSound(); - return; + } else { + if (_omniTVFile) { + // Restore state + _fd = _omniTVFile; + _mixer->pauseHandle(_omniTVSound, false); + + _vm->setBitFlag(42, false); + _omniTV = true; + } else { + _vm->_variableArray[254] = 6747; + } } } @@ -120,7 +129,7 @@ void MoviePlayer::play() { return; } - if (!_fd.isOpen()) { + if (!_fd) { return; } @@ -161,14 +170,14 @@ void MoviePlayer::startSound() { byte *buffer; uint32 offset, size, tag; - tag = _fd.readUint32BE(); + tag = _fd->readUint32BE(); if (tag == MKID_BE('WAVE')) { - size = _fd.readUint32BE(); + size = _fd->readUint32BE(); if (_sequenceNum) { Common::File in; - _fd.seek(size, SEEK_CUR); + _fd->seek(size, SEEK_CUR); in.open((const char *)"audio.wav"); if (!in.isOpen()) { @@ -185,7 +194,7 @@ void MoviePlayer::startSound() { in.close(); } else { buffer = (byte *)malloc(size); - _fd.read(buffer, size); + _fd->read(buffer, size); } Common::MemoryReadStream stream(buffer, size); @@ -196,8 +205,13 @@ void MoviePlayer::startSound() { } if (_bgSoundStream != NULL) { - _mixer->stopHandle(_bgSound); - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream); + if (_omniTV) { + _mixer->stopHandle(_omniTVSound); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_omniTVSound, _bgSoundStream); + } else { + _mixer->stopHandle(_bgSound); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream); + } } } @@ -206,8 +220,12 @@ void MoviePlayer::nextFrame() { return; if (_vm->getBitFlag(42)) { + // Save state + _omniTVFile = _fd; + _mixer->pauseHandle(_omniTVSound, true); + + _fd = 0; _omniTV = false; - closeFile(); return; } @@ -222,6 +240,7 @@ void MoviePlayer::nextFrame() { _frameNum++; } else { _omniTV = false; + _omniTVFile = 0; closeFile(); _vm->_variableArray[254] = 6747; } diff --git a/engines/agos/animation.h b/engines/agos/animation.h index 310cd0c05f..6776395ab7 100644 --- a/engines/agos/animation.h +++ b/engines/agos/animation.h @@ -44,6 +44,9 @@ class MoviePlayer : public Graphics::DXAPlayer { Audio::SoundHandle _bgSound; Audio::AudioStream *_bgSoundStream; + Audio::SoundHandle _omniTVSound; + Common::SeekableReadStream *_omniTVFile; + bool _omniTV; bool _leftButtonDown; bool _rightButtonDown; |
