diff options
author | Filippos Karapetis | 2011-10-18 02:38:26 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-10-18 02:38:26 +0300 |
commit | 021b09d35c9375750849fde8572c1ed28a1883e8 (patch) | |
tree | 877e61767272e2587e87d87f6f9729ff5107a8a8 /engines/sci/engine | |
parent | 701e318360ce8d400a59d5890be8ad335d04b326 (diff) | |
download | scummvm-rg350-021b09d35c9375750849fde8572c1ed28a1883e8.tar.gz scummvm-rg350-021b09d35c9375750849fde8572c1ed28a1883e8.tar.bz2 scummvm-rg350-021b09d35c9375750849fde8572c1ed28a1883e8.zip |
SCI: Initial implementation of kPlayDuck for Phantasmagoria 2
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kernel.h | 3 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 3 | ||||
-rw-r--r-- | engines/sci/engine/kvideo.cpp | 34 |
3 files changed, 40 insertions, 0 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index e0ab954641..2ed705465f 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -477,6 +477,9 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv); reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv); reg_t kFont(EngineState *s, int argc, reg_t *argv); reg_t kBitmap(EngineState *s, int argc, reg_t *argv); + +// SCI3 Kernel functions +reg_t kPlayDuck(EngineState *s, int argc, reg_t *argv); #endif reg_t kDoSoundInit(EngineState *s, int argc, reg_t *argv); diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 8d20816b65..6692fa7536 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -626,6 +626,9 @@ static SciKernelMapEntry s_kernelMap[] = { // (inclusive) are set to 0 // MorphOn - used by SQ6, script 900, the datacorder reprogramming puzzle (from room 270) // SetHotRectangles - used by Phantasmagoria 1 + + // SCI3 Kernel Functions + { MAP_CALL(PlayDuck), SIG_EVERYWHERE, "(.*)", NULL, NULL }, #endif { NULL, NULL, SIG_EVERYWHERE, NULL, NULL, NULL } diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index c845ef27e0..3087e46d2c 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -376,6 +376,40 @@ reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv) { return s->r_acc; } +reg_t kPlayDuck(EngineState *s, int argc, reg_t *argv) { + uint16 operation = argv[0].toUint16(); + Video::VideoDecoder *videoDecoder = 0; + bool reshowCursor = g_sci->_gfxCursor->isVisible(); + + switch (operation) { + case 1: // Play + // 6 params + s->_videoState.reset(); + s->_videoState.fileName = Common::String::format("%d.duk", argv[1].toUint16()); + + videoDecoder = new Video::AviDecoder(g_system->getMixer()); + + if (!videoDecoder->loadFile(s->_videoState.fileName)) { + warning("Could not open Duck %s", s->_videoState.fileName.c_str()); + break; + } + + if (reshowCursor) + g_sci->_gfxCursor->kernelHide(); + + playVideo(videoDecoder, s->_videoState); + + if (reshowCursor) + g_sci->_gfxCursor->kernelShow(); + break; + default: + kStub(s, argc, argv); + break; + } + + return s->r_acc; +} + #endif } // End of namespace Sci |