diff options
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/console.cpp | 34 | ||||
-rw-r--r-- | engines/zvision/console.h | 1 | ||||
-rw-r--r-- | engines/zvision/video.cpp | 1 |
3 files changed, 27 insertions, 9 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index 3af67408cb..3721c94f42 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -26,21 +26,37 @@ #include "zvision/console.h" #include "zvision/zvision.h" +#include "zvision/zork_avi_decoder.h" namespace ZVision { - Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { - DCmd_Register("loadimage", WRAP_METHOD(Console, cmdLoadImage)); +Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { + DCmd_Register("loadimage", WRAP_METHOD(Console, cmdLoadImage)); + DCmd_Register("loadvideo", WRAP_METHOD(Console, cmdLoadVideo)); +} + +bool Console::cmdLoadImage(int argc, const char **argv) { + if (argc != 4) { + DebugPrintf("Use loadimage <fileName> <x> <y> to load an image to the screen"); + return false; } + _engine->renderImageToScreen(argv[1], atoi(argv[2]), atoi(argv[3])); + + return true; +} - bool Console::cmdLoadImage(int argc, const char **argv) { - if (argc != 4) { - DebugPrintf("Use loadimage <fileName> <x> <y> to load an image to the screen"); - return false; - } - _engine->renderImageToScreen(argv[1], atoi(argv[2]), atoi(argv[3])); +bool Console::cmdLoadVideo(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Use loadvideo <fileName> to load a video to the screen"); + return false; + } - return true; + Video::VideoDecoder *videoDecoder = new ZorkAVIDecoder(); + if (videoDecoder && videoDecoder->loadFile(argv[1])) { + _engine->startVideo(videoDecoder); } + return true; +} + } // End of namespace ZVision diff --git a/engines/zvision/console.h b/engines/zvision/console.h index c341b8d226..66037983ae 100644 --- a/engines/zvision/console.h +++ b/engines/zvision/console.h @@ -38,6 +38,7 @@ namespace ZVision { ZVision *_engine; bool cmdLoadImage(int argc, const char **argv); + bool cmdLoadVideo(int argc, const char **argv); }; } // End of namespace ZVision diff --git a/engines/zvision/video.cpp b/engines/zvision/video.cpp index 5e27e3ada1..b5e9fa098c 100644 --- a/engines/zvision/video.cpp +++ b/engines/zvision/video.cpp @@ -82,6 +82,7 @@ void ZVision::startVideo(Video::VideoDecoder *videoDecoder) { initGraphics(640, 480, true, formats); _currentVideo->start(); + // Load the first frame continueVideo(); } |