diff options
author | Travis Howell | 2006-06-02 11:33:11 +0000 |
---|---|---|
committer | Travis Howell | 2006-06-02 11:33:11 +0000 |
commit | b0733e0fc1eec5cfac9fac6c1ea40260257faa0e (patch) | |
tree | 83f022bdbd3070bcc65f166ec1d9ffab2f2316b2 /engines | |
parent | f3f7b670d0572b3355df6ada4e512ae60b488e51 (diff) | |
download | scummvm-rg350-b0733e0fc1eec5cfac9fac6c1ea40260257faa0e.tar.gz scummvm-rg350-b0733e0fc1eec5cfac9fac6c1ea40260257faa0e.tar.bz2 scummvm-rg350-b0733e0fc1eec5cfac9fac6c1ea40260257faa0e.zip |
Add support for separate compressed sound files for cutscenes in FF
svn-id: r22831
Diffstat (limited to 'engines')
-rw-r--r-- | engines/simon/animation.cpp | 19 | ||||
-rw-r--r-- | engines/simon/animation.h | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/engines/simon/animation.cpp b/engines/simon/animation.cpp index deedd37e5c..776947cded 100644 --- a/engines/simon/animation.cpp +++ b/engines/simon/animation.cpp @@ -63,6 +63,8 @@ MoviePlayer::MoviePlayer(SimonEngine *vm, Audio::Mixer *mixer) _frameTicks = 0; _frameSkipped = 0; + memset(baseName, 0, sizeof(baseName)); + _sequenceNum = 0; _ticks = 0; } @@ -76,12 +78,15 @@ bool MoviePlayer::load(const char *filename) { int32 frameRate; uint i; + int baseLen = strlen(filename) - 4; + memset(baseName, 0, sizeof(baseName)); + memcpy(baseName, filename, baseLen); + // Change file extension to dxa strcpy(filename2, filename); - int len = strlen(filename2) - 3; - filename2[len++] = 'd'; - filename2[len++] = 'x'; - filename2[len++] = 'a'; + filename2[baseLen + 1] = 'd'; + filename2[baseLen + 2] = 'x'; + filename2[baseLen + 3] = 'a'; if (_fd.open(filename2) == false) { warning("Failed to load video file %s", filename2); @@ -234,6 +239,12 @@ void MoviePlayer::startSound() { _mixer->stopHandle(_bgSound); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream); free(buffer); + } else { + _bgSoundStream = Audio::AudioStream::openStreamFile(baseName); + if (_bgSoundStream != NULL) { + _mixer->stopHandle(_bgSound); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream); + } } } diff --git a/engines/simon/animation.h b/engines/simon/animation.h index 5e7674b79f..5f815ed631 100644 --- a/engines/simon/animation.h +++ b/engines/simon/animation.h @@ -58,6 +58,7 @@ class MoviePlayer { uint32 _frameTicks; uint32 _ticks; + char baseName[40]; static const char *_sequenceList[90]; uint8 _sequenceNum; public: |