diff options
author | Torbjörn Andersson | 2006-08-26 12:29:00 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-08-26 12:29:00 +0000 |
commit | cc3b4cdf9937f3d89bb058f9af652c1b371f7222 (patch) | |
tree | 7886990150583d75f427e6e44c16024ec16152c2 /engines/sword2 | |
parent | 96ec0d08ac6498f8d05996e048ae587b4bcb0c50 (diff) | |
download | scummvm-rg350-cc3b4cdf9937f3d89bb058f9af652c1b371f7222.tar.gz scummvm-rg350-cc3b4cdf9937f3d89bb058f9af652c1b371f7222.tar.bz2 scummvm-rg350-cc3b4cdf9937f3d89bb058f9af652c1b371f7222.zip |
Now that the cutscene handling in both BS1 and BS2 has been extended to play
DXA movies (the MPEG movies still work, of course), there is no longer any need
for the MPEG decoder to handle sound and frame syncing. That is now the
responsibility of the player, not the decoder.
The obvious next step, then, would be to put that in a new player class, and
have both BS1 and BS2 use that. Maybe FF as well.
svn-id: r23757
Diffstat (limited to 'engines/sword2')
-rw-r--r-- | engines/sword2/animation.cpp | 13 | ||||
-rw-r--r-- | engines/sword2/animation.h | 3 |
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 9f134621ec..bf60623f92 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -75,6 +75,7 @@ MoviePlayer::MoviePlayer(Sword2Engine *vm) { _vm = vm; _mixer = _vm->_mixer; _system = _vm->_system; + _name = NULL; _textSurface = NULL; _bgSoundStream = NULL; _ticks = 0; @@ -96,6 +97,7 @@ MoviePlayer::MoviePlayer(Sword2Engine *vm) { } MoviePlayer::~MoviePlayer() { + free(_name); } void MoviePlayer::updatePalette(byte *pal, bool packed) { @@ -278,6 +280,8 @@ bool MoviePlayer::load(const char *name, MovieTextObject *text[]) { _currentText = 0; _currentFrame = 0; + _name = strdup(name); + for (int i = 0; i < ARRAYSIZE(_movies); i++) { if (scumm_stricmp(name, _movies[i].name) == 0) { _seamless = _movies[i].seamless; @@ -335,8 +339,8 @@ void MoviePlayer::play(int32 leadIn, int32 leadOut) { #endif _framesSkipped = 0; - _ticks = _system->getMillis(); + _bgSoundStream = Audio::AudioStream::openStreamFile(_name); if (_bgSoundStream) { _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSoundHandle, _bgSoundStream); @@ -504,8 +508,6 @@ bool MoviePlayerDXA::load(const char *name, MovieTextObject *text[]) { _frameX = (_vm->_screen->getScreenWide() - _frameWidth) / 2; _frameY = (_vm->_screen->getScreenDeep() - _frameHeight) / 2; - _bgSoundStream = Audio::AudioStream::openStreamFile(name); - return true; } @@ -566,11 +568,8 @@ bool MoviePlayerMPEG::decodeFrame() { return result; } -void MoviePlayerMPEG::syncFrame() { -} - AnimationState::AnimationState(Sword2Engine *vm, MoviePlayer *player) - : BaseAnimationState(vm->_mixer, vm->_system, 640, 480) { + : BaseAnimationState(vm->_system, 640, 480) { _vm = vm; _player = player; } diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h index 337ee2b630..99c4231585 100644 --- a/engines/sword2/animation.h +++ b/engines/sword2/animation.h @@ -57,6 +57,8 @@ protected: Audio::Mixer *_mixer; OSystem *_system; + char *_name; + byte _originalPalette[4 * 256]; byte *_textSurface; @@ -156,7 +158,6 @@ protected: AnimationState *_anim; virtual bool decodeFrame(); - virtual void syncFrame(); #ifndef BACKEND_8BIT void handleScreenChanged(); |