aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-10 17:18:29 -0500
committerrichiesams2013-08-10 17:18:29 -0500
commit2176aa55fc71fb7ac8b44f81fcc070c927e3d505 (patch)
tree7097bc48418ae8292a4b023c21961a7593c11042 /engines/zvision
parent694a6099a6f4da7807b1ac1efba75953522da206 (diff)
downloadscummvm-rg350-2176aa55fc71fb7ac8b44f81fcc070c927e3d505.tar.gz
scummvm-rg350-2176aa55fc71fb7ac8b44f81fcc070c927e3d505.tar.bz2
scummvm-rg350-2176aa55fc71fb7ac8b44f81fcc070c927e3d505.zip
ZVISION: Implement ActionStreamVideo
Diffstat (limited to 'engines/zvision')
-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)) {