aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorMarisa-Chan2014-11-12 14:31:48 +0600
committerMarisa-Chan2014-11-12 14:31:48 +0600
commit54917582eb60c28c093cf84d78f5641a8ea02ea8 (patch)
treec7523b8aa6494ac547292ce2f325bb4d8e2f2ace /engines/zvision
parent51a9ec80df468757902cd85a5ab2a32856148d29 (diff)
downloadscummvm-rg350-54917582eb60c28c093cf84d78f5641a8ea02ea8.tar.gz
scummvm-rg350-54917582eb60c28c093cf84d78f5641a8ea02ea8.tar.bz2
scummvm-rg350-54917582eb60c28c093cf84d78f5641a8ea02ea8.zip
ZVISION: Implement missing action - cursor
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/scripting/actions.cpp33
-rw-r--r--engines/zvision/scripting/actions.h9
-rw-r--r--engines/zvision/scripting/scr_file_handling.cpp2
3 files changed, 44 insertions, 0 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index 04f318b84e..f27427caa9 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -43,6 +43,7 @@
#include "zvision/graphics/effects/light.h"
#include "zvision/graphics/effects/wave.h"
#include "zvision/core/save_manager.h"
+#include "zvision/cursors/cursor_manager.h"
#include "common/file.h"
@@ -162,6 +163,38 @@ bool ActionCrossfade::execute() {
}
//////////////////////////////////////////////////////////////////////////////
+// ActionCursor
+//////////////////////////////////////////////////////////////////////////////
+
+ActionCursor::ActionCursor(ZVision *engine, int32 slotkey, const Common::String &line) :
+ ResultAction(engine, slotkey) {
+ Common::String up = line;
+ up.toUppercase();
+ _action = 0;
+
+ if (up[0] == 'B')
+ _action = 2;
+ else if (up[0] == 'I')
+ _action = 3;
+ else if (up[0] == 'U')
+ _action = 0;
+ else if (up[0] == 'H')
+ _action = 1;
+}
+
+bool ActionCursor::execute() {
+ switch (_action) {
+ case 1:
+ _engine->getCursorManager()->showMouse(false);
+ break;
+ default:
+ _engine->getCursorManager()->showMouse(true);
+ break;
+ }
+ return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////
// ActionDelayRender
//////////////////////////////////////////////////////////////////////////////
diff --git a/engines/zvision/scripting/actions.h b/engines/zvision/scripting/actions.h
index a6b5aa1290..5401af0876 100644
--- a/engines/zvision/scripting/actions.h
+++ b/engines/zvision/scripting/actions.h
@@ -148,6 +148,15 @@ private:
int32 _timeInMillis;
};
+class ActionCursor : public ResultAction {
+public:
+ ActionCursor(ZVision *engine, int32 slotkey, const Common::String &line);
+ bool execute();
+
+private:
+ uint8 _action;
+};
+
class ActionDebug : public ResultAction {
public:
ActionDebug(ZVision *engine, int32 slotkey, const Common::String &line);
diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp
index de092183c6..5e0387f0d9 100644
--- a/engines/zvision/scripting/scr_file_handling.cpp
+++ b/engines/zvision/scripting/scr_file_handling.cpp
@@ -229,6 +229,8 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
actionList.push_back(new ActionChangeLocation(_engine, slot, args));
} else if (act.matchString("crossfade", true)) {
actionList.push_back(new ActionCrossfade(_engine, slot, args));
+ } else if (act.matchString("cursor", true)) {
+ actionList.push_back(new ActionCursor(_engine, slot, args));
} else if (act.matchString("debug", true)) {
// Not used. Purposely left empty
} else if (act.matchString("delay_render", true)) {