diff options
author | Torbjörn Andersson | 2005-04-25 05:23:21 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-04-25 05:23:21 +0000 |
commit | 8776150321abb1d7d5f6ceb512713583e53d605e (patch) | |
tree | 5c95f937c2eace49b0190fa46ef0f4b03d3c4acb | |
parent | eb3b057836ff5a88d10730ed6f9e059689364209 (diff) | |
download | scummvm-rg350-8776150321abb1d7d5f6ceb512713583e53d605e.tar.gz scummvm-rg350-8776150321abb1d7d5f6ceb512713583e53d605e.tar.bz2 scummvm-rg350-8776150321abb1d7d5f6ceb512713583e53d605e.zip |
Better support for "seamless" cutscenes, i.e. ones where - in theory - you
shouldn't see where the cutscene begins/ends as it's the same image as is
currently displayed by the game engine itself.
Of course, in reality you can still see the seams easily. But at least it
looks a bit beter now. I made most of this change yesterday, but it's less
hard-wired now.
svn-id: r17797
-rw-r--r-- | sword2/driver/animation.cpp | 102 | ||||
-rw-r--r-- | sword2/driver/animation.h | 4 |
2 files changed, 60 insertions, 46 deletions
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index 2d75cf713e..ec1d2b56ff 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -109,25 +109,25 @@ void AnimationState::drawYUV(int width, int height, byte *const *dat) { } MovieInfo MoviePlayer::_movies[] = { - { "carib", 222 }, - { "escape", 187 }, - { "eye", 248 }, - { "finale", 1485 }, - { "guard", 75 }, - { "intro", 1800 }, - { "jungle", 186 }, - { "museum", 167 }, - { "pablo", 75 }, - { "pyramid", 60 }, - { "quaram", 184 }, - { "river", 656 }, - { "sailing", 138 }, - { "shaman", 788 }, - { "stone1", 34 }, - { "stone2", 282 }, - { "stone3", 65 }, - { "demo", 60 }, - { "enddemo", 110 } + { "carib", 222, false }, + { "escape", 187, false }, + { "eye", 248, false }, + { "finale", 1485, false }, + { "guard", 75, false }, + { "intro", 1800, false }, + { "jungle", 186, false }, + { "museum", 167, false }, + { "pablo", 75, false }, + { "pyramid", 60, false }, + { "quaram", 184, false }, + { "river", 656, false }, + { "sailing", 138, false }, + { "shaman", 788, true }, + { "stone1", 34, false }, + { "stone2", 282, false }, + { "stone3", 65, false }, + { "demo", 60, false }, + { "enddemo", 110, false } }; MoviePlayer::MoviePlayer(Sword2Engine *vm) @@ -173,6 +173,11 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea if (_vm->_quit) return RD_OK; + if (scumm_stricmp(filename, "shaman") == 0) + _seamless = true; + else + _seamless = false; + if (leadInRes) { byte *leadIn = _vm->_resman->openResource(leadInRes); uint32 leadInLen = _vm->_resman->fetchLen(leadInRes) - sizeof(StandardHeader); @@ -198,6 +203,22 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea leadOut += sizeof(StandardHeader); } + _leadOutFrame = (uint) -1; + + int i; + + for (i = 0; i < ARRAYSIZE(_movies); i++) { + if (scumm_stricmp(filename, _movies[i].name) == 0) { + _seamless = _movies[i].seamless; + if (_movies[i].frames > 60) + _leadOutFrame = _movies[i].frames - 60; + break; + } + } + + if (i == ARRAYSIZE(_movies)) + warning("Unknown movie, '%s'", filename); + #ifdef USE_MPEG2 playMPEG(filename, text, leadOut, leadOutLen); #else @@ -208,10 +229,10 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 lea _snd->stopHandle(leadInHandle); // Wait for the lead-out to stop, if there is any. Though don't do it - // for the "shaman" cutscene as it's obviously meant to blend into the - // rest of the game, and the lead-out goes on for a long time. + // for seamless movies, since they are meant to blend into the rest of + // the game. - if (scumm_stricmp(filename, "shaman") != 0) { + if (!_seamless) { while (_vm->_mixer->isSoundHandleActive(_leadOutHandle)) { _vm->_screen->updateDisplay(); _vm->_system->delayMillis(30); @@ -257,22 +278,6 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * flags |= SoundMixer::FLAG_LITTLE_ENDIAN; #endif - int i; - uint leadOutFrame = (uint) -1; - - for (i = 0; i < ARRAYSIZE(_movies); i++) { - if (scumm_stricmp(filename, _movies[i].name) == 0) { - if (_movies[i].frames >= 60) - leadOutFrame = _movies[i].frames - 60; - else - leadOutFrame = 0; - break; - } - } - - if (i == ARRAYSIZE(_movies)) - warning("Unknown movie, '%s'", filename); - while (!skipCutscene && anim->decodeFrame()) { // The frame has been drawn. Now draw the subtitles, if any, // before updating the screen. @@ -305,7 +310,7 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * anim->updateScreen(); frameCounter++; - if (frameCounter == leadOutFrame && leadOut) + if (frameCounter == _leadOutFrame && leadOut) _vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, SoundMixer::kMaxChannelVolume, 0, false, SoundMixer::kMusicSoundType); OSystem::Event event; @@ -335,11 +340,14 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * _sys->delayMillis(1000 / 12); } - // Most movies fade to black on their own, but not all of them. Since - // we may be hanging around in the cutscene player for a while longer, - // waiting for the lead-out sound to finish, paint the overlay black. + if (!_seamless) { + // Most movies fade to black on their own, but not all of them. + // Since we may be hanging around in the cutscene player for a + // while longer, waiting for the lead-out sound to finish, + // paint the overlay black. - anim->clearScreen(); + anim->clearScreen(); + } // If the speech is still playing, redraw the subtitles. At least in // the English version this is most noticeable in the "carib" cutscene. @@ -364,9 +372,11 @@ void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte * _sys->delayMillis(100); } - // Clear the screen again - anim->clearScreen(); - anim->updateScreen(); + if (!_seamless) { + // Clear the screen again + anim->clearScreen(); + anim->updateScreen(); + } _vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT); diff --git a/sword2/driver/animation.h b/sword2/driver/animation.h index c9d75da66e..3d6c3fc385 100644 --- a/sword2/driver/animation.h +++ b/sword2/driver/animation.h @@ -67,6 +67,7 @@ private: struct MovieInfo { char name[9]; uint frames; + bool seamless; }; class MoviePlayer { @@ -79,6 +80,9 @@ private: SoundHandle _leadOutHandle; + uint _leadOutFrame; + bool _seamless; + static struct MovieInfo _movies[]; void openTextObject(MovieTextObject *obj); |