[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.60,1.61 animation.h,1.35,1.36
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Sun Apr 24 22:23:47 CEST 2005
Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20493/driver
Modified Files:
animation.cpp animation.h
Log Message:
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.
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- animation.cpp 24 Apr 2005 15:38:53 -0000 1.60
+++ animation.cpp 25 Apr 2005 05:23:21 -0000 1.61
@@ -109,25 +109,25 @@
}
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 @@
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 @@
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 @@
_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 @@
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 @@
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 @@
_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 @@
_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);
Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- animation.h 12 Mar 2005 18:56:09 -0000 1.35
+++ animation.h 25 Apr 2005 05:23:21 -0000 1.36
@@ -67,6 +67,7 @@
struct MovieInfo {
char name[9];
uint frames;
+ bool seamless;
};
class MoviePlayer {
@@ -79,6 +80,9 @@
SoundHandle _leadOutHandle;
+ uint _leadOutFrame;
+ bool _seamless;
+
static struct MovieInfo _movies[];
void openTextObject(MovieTextObject *obj);
More information about the Scummvm-git-logs
mailing list