diff options
-rw-r--r-- | engines/scumm/he/animation_he.cpp | 22 | ||||
-rw-r--r-- | engines/scumm/he/animation_he.h | 11 | ||||
-rw-r--r-- | engines/scumm/he/script_v100he.cpp | 12 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 2 |
4 files changed, 33 insertions, 14 deletions
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp index 0c737ed899..13f52e468b 100644 --- a/engines/scumm/he/animation_he.cpp +++ b/engines/scumm/he/animation_he.cpp @@ -26,10 +26,12 @@ #include "scumm/he/animation_he.h" #include "scumm/he/intern_he.h" +#include "sound/audiostream.h" + namespace Scumm { -MoviePlayer::MoviePlayer(ScummEngine_v90he *vm) - : DXAPlayer(), _vm(vm) { +MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer) + : DXAPlayer(), _vm(vm), _mixer(mixer) { _flags = 0; _wizResNum = 0; @@ -48,12 +50,12 @@ int MoviePlayer::load(const char *filename, int flags, int image) { closeFile(); } + int baseLen = strlen(filename) - 4; + memset(baseName, 0, sizeof(baseName)); + memcpy(baseName, filename, baseLen); + // Change file extension to dxa - strcpy(videoName, filename); - int len = strlen(videoName) - 3; - videoName[len++] = 'd'; - videoName[len++] = 'x'; - videoName[len++] = 'a'; + sprintf(videoName, "%s.dxa", baseName); if (!loadFile(videoName)) { warning("Failed to load video file %s", videoName); @@ -71,6 +73,12 @@ int MoviePlayer::load(const char *filename, int flags, int image) { _flags = flags; _wizResNum = image; + _bgSoundStream = Audio::AudioStream::openStreamFile(baseName); + if (_bgSoundStream != NULL) { + _mixer->stopHandle(_bgSound); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream); + } + return 0; } diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h index f1c40a65a9..0e609669f0 100644 --- a/engines/scumm/he/animation_he.h +++ b/engines/scumm/he/animation_he.h @@ -25,8 +25,11 @@ #define ANIMATION_H #include "common/file.h" + #include "graphics/dxa_player.h" +#include "sound/mixer.h" + namespace Scumm { class ScummEngine_v90he; @@ -34,11 +37,17 @@ class ScummEngine_v90he; class MoviePlayer : public Graphics::DXAPlayer { ScummEngine_v90he *_vm; + Audio::Mixer *_mixer; + + Audio::SoundHandle _bgSound; + Audio::AudioStream *_bgSoundStream; + + char baseName[40]; uint32 _flags; uint32 _wizResNum; public: - MoviePlayer(ScummEngine_v90he *vm); + MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer); int getImageNum(); int load(const char *filename, int flags, int image = 0); diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index 0a693c69bb..323bd32a05 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -2891,29 +2891,31 @@ void ScummEngine_v100he::o100_getVideoData() { switch (subOp) { case 0: pop(); + push(_moviePlay->getFrameCount()); break; case 13: pop(); + push(_moviePlay->getHeight()); break; case 14: pop(); + push(_moviePlay->getImageNum()); break; case 28: - pop(); - pop(); + debug(0, "o100_getVideoData: subOp 28 stub (%d, %d)", pop(), pop()); + push(0); break; case 47: pop(); + push(_moviePlay->getCurFrame()); break; case 58: pop(); + push(_moviePlay->getWidth()); break; default: error("o100_getVideoData: unhandled case %d", subOp); } - - push(-1); - debug(1,"o100_getVideoData stub (%d)", subOp); } void ScummEngine_v100he::decodeParseString(int m, int n) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 38de7b602a..6fbd551200 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -735,7 +735,7 @@ ScummEngine_v80he::ScummEngine_v80he(OSystem *syst, const DetectorResult &dr) ScummEngine_v90he::ScummEngine_v90he(OSystem *syst, const DetectorResult &dr) : ScummEngine_v80he(syst, dr) { - _moviePlay = new MoviePlayer(this); + _moviePlay = new MoviePlayer(this, _mixer); _sprite = new Sprite(this); memset(_videoParams.filename, 0, sizeof(_videoParams.filename)); |