aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/actions.cpp31
-rw-r--r--engines/zvision/actions.h15
-rw-r--r--engines/zvision/scr_file_handling.cpp3
3 files changed, 47 insertions, 2 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp
index 81b6960378..8c10837a1f 100644
--- a/engines/zvision/actions.cpp
+++ b/engines/zvision/actions.cpp
@@ -32,6 +32,7 @@
#include "zvision/render_manager.h"
#include "zvision/action_node.h"
#include "zvision/zork_raw.h"
+#include "zvision/zork_avi_decoder.h"
namespace ZVision {
@@ -249,6 +250,36 @@ bool ActionSetScreen::execute(ZVision *engine) {
//////////////////////////////////////////////////////////////////////////////
+// ActionStreamVideo
+//////////////////////////////////////////////////////////////////////////////
+
+ActionStreamVideo::ActionStreamVideo(const Common::String &line) {
+ char fileName[25];
+ uint skippable;
+
+ sscanf(line.c_str(), "%*[^(](%25s %u %u %u %u %u %u)", fileName, &_x, &_y, &_width, &_height, &_flags, &skippable);
+
+ _fileName = Common::String(fileName);
+ _skippable = (skippable == 0) ? false : true;
+}
+
+bool ActionStreamVideo::execute(ZVision *engine) {
+ ZorkAVIDecoder decoder;
+ if (!decoder.loadFile(_fileName)) {
+ return true;
+ }
+
+ Common::Rect destRect;
+ if ((_flags & 0x1) == 0x1) {
+ destRect = Common::Rect(_x, _y, _x + _width, _y + _height);
+ }
+
+ engine->playVideo(decoder, destRect, _skippable);
+ return true;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
// ActionTimer
//////////////////////////////////////////////////////////////////////////////
diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h
index 48703b95e5..bb446171fe 100644
--- a/engines/zvision/actions.h
+++ b/engines/zvision/actions.h
@@ -286,6 +286,21 @@ private:
Common::String _fileName;
};
+class ActionStreamVideo : public ResultAction {
+public:
+ ActionStreamVideo(const Common::String &line);
+ bool execute(ZVision *engine);
+
+private:
+ Common::String _fileName;
+ uint _x;
+ uint _y;
+ uint _width;
+ uint _height;
+ uint _flags;
+ bool _skippable;
+};
+
class ActionTimer : public ResultAction {
public:
ActionTimer(const Common::String &line);
diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp
index 0bb8d2690b..061079cd85 100644
--- a/engines/zvision/scr_file_handling.cpp
+++ b/engines/zvision/scr_file_handling.cpp
@@ -239,8 +239,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (line.matchString("*:streamvideo*", true)) {
-
-
+ actionList.push_back(Common::SharedPtr<ResultAction>(new ActionStreamVideo(line)));
} else if (line.matchString("*:syncsound*", true)) {