aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichiesams2013-07-08 16:14:02 -0500
committerrichiesams2013-08-04 13:32:09 -0500
commit4398c04a7b20c5ccb5033d04430479c795f9dff8 (patch)
treec0ed3660c719c3bd50923a1064c42d2bb0997d0f
parent76b2aa33ca129b1c7a626f1a043e5d828e72af57 (diff)
downloadscummvm-rg350-4398c04a7b20c5ccb5033d04430479c795f9dff8.tar.gz
scummvm-rg350-4398c04a7b20c5ccb5033d04430479c795f9dff8.tar.bz2
scummvm-rg350-4398c04a7b20c5ccb5033d04430479c795f9dff8.zip
ZVISION: Create console command for loading a video
-rw-r--r--engines/zvision/console.cpp34
-rw-r--r--engines/zvision/console.h1
-rw-r--r--engines/zvision/video.cpp1
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();
}