[Scummvm-cvs-logs] SF.net SVN: scummvm:[47911] scummvm/trunk/engines/sci/engine/kgraphics.cpp
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Fri Feb 5 20:41:06 CET 2010
Revision: 47911
http://scummvm.svn.sourceforge.net/scummvm/?rev=47911&view=rev
Author: mthreepwood
Date: 2010-02-05 19:41:06 +0000 (Fri, 05 Feb 2010)
Log Message:
-----------
Cleanup kShowMovie; merge the SCI1.1/SCI2 and SCI2.1 AVI code.
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-02-05 19:33:39 UTC (rev 47910)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-02-05 19:41:06 UTC (rev 47911)
@@ -1115,11 +1115,6 @@
reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
bool playedVideo = false;
- // KQ6 Windows calls this with one argument. It doesn't seem
- // to have a purpose...
- if (argc == 1)
- return NULL_REG;
-
// Hide the cursor if it's showing and then show it again if it was
// previously visible.
bool reshowCursor;
@@ -1128,32 +1123,41 @@
if (reshowCursor)
s->_gfxCursor->kernelHide();
- // The Windows and DOS versions use different video format as well
- // as a different argument set.
- if (argv[0].toUint16() == 0) {
- // Windows (SCI1.1/SCI2)
- Common::String filename = s->_segMan->getString(argv[1]);
+ if (argv[0].segment != 0) {
+ // DOS SEQ
+ // SEQ's are called with no subops, just the string and delay
+ Common::String filename = s->_segMan->getString(argv[0]);
+ int delay = argv[1].toUint16(); // Time between frames in ticks
- Graphics::AviDecoder *aviDecoder = new Graphics::AviDecoder(g_system->getMixer());
- Graphics::VideoPlayer *player = new Graphics::VideoPlayer(aviDecoder);
- if (aviDecoder->loadFile(filename.c_str())) {
+ SeqDecoder *seqDecoder = new SeqDecoder();
+ Graphics::VideoPlayer *player = new Graphics::VideoPlayer(seqDecoder);
+ if (seqDecoder->loadFile(filename.c_str(), delay)) {
player->playVideo();
playedVideo = true;
} else {
warning("Failed to open movie file %s", filename.c_str());
}
- aviDecoder->closeFile();
+ seqDecoder->closeFile();
delete player;
- delete aviDecoder;
-#ifdef ENABLE_SCI32
- } else if (argv[0].toUint16() == 1) {
- // Windows (SCI2.1)
-
+ delete seqDecoder;
+ } else {
+ // Windows AVI (Macintosh QuickTime? Need to check KQ6 Macintosh)
// TODO: This appears to be some sort of subop. case 0 contains the string
// for the video, so we'll just play it from there for now.
- switch (argv[1].toUint16()) {
+
+#ifdef ENABLE_SCI32
+ if (getSciVersion() >= SCI_VERSION_2_1) {
+ // SCI2.1 always has argv[0] as 1, the rest of the arguments seem to
+ // follow SCI1.1/2.
+ if (argv[0].toUint16() != 1)
+ error("SCI2.1 kShowMovie argv[0] not 1");
+ argv++;
+ argc--;
+ }
+#endif
+ switch (argv[0].toUint16()) {
case 0: {
- Common::String filename = s->_segMan->getString(argv[2]);
+ Common::String filename = s->_segMan->getString(argv[1]);
Graphics::AviDecoder *aviDecoder = new Graphics::AviDecoder(g_system->getMixer());
Graphics::VideoPlayer *player = new Graphics::VideoPlayer(aviDecoder);
if (aviDecoder->loadFile(filename.c_str())) {
@@ -1168,30 +1172,12 @@
break;
}
default:
- warning("Unhandled SCI2.1 kShowMovie subop %d", argv[1].toUint16());
+ warning("Unhandled SCI kShowMovie subop %d", argv[1].toUint16());
}
-#endif
- } else {
- // DOS
- Common::String filename = s->_segMan->getString(argv[0]);
- int delay = argv[1].toUint16(); // Time between frames in ticks
-
- SeqDecoder *seqDecoder = new SeqDecoder();
- Graphics::VideoPlayer *player = new Graphics::VideoPlayer(seqDecoder);
- if (seqDecoder->loadFile(filename.c_str(), delay)) {
- player->playVideo();
- playedVideo = true;
- } else {
- warning("Failed to open movie file %s", filename.c_str());
- }
- seqDecoder->closeFile();
- delete player;
- delete seqDecoder;
}
- if (playedVideo) {
+ if (playedVideo)
s->_gfxScreen->kernelSyncWithFramebuffer();
- }
if (reshowCursor)
s->_gfxCursor->kernelShow();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list