aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2014-07-12 21:35:50 +0000
committerMarisa-Chan2014-07-12 21:35:50 +0000
commit57857a1d768fc9b226326efe2294f73e847c816e (patch)
treea28c7889ba4eff124c4ac69296d93f9c45582065
parentb9103b8d19a5da396d217e8d9bcc5c1502b89837 (diff)
downloadscummvm-rg350-57857a1d768fc9b226326efe2294f73e847c816e.tar.gz
scummvm-rg350-57857a1d768fc9b226326efe2294f73e847c816e.tar.bz2
scummvm-rg350-57857a1d768fc9b226326efe2294f73e847c816e.zip
ZVISION: Controls now can return type of control.
-rw-r--r--engines/zvision/scripting/control.h23
-rw-r--r--engines/zvision/scripting/controls/input_control.cpp2
-rw-r--r--engines/zvision/scripting/controls/lever_control.cpp2
-rw-r--r--engines/zvision/scripting/controls/push_toggle_control.cpp2
-rw-r--r--engines/zvision/scripting/controls/slot_control.cpp2
5 files changed, 26 insertions, 5 deletions
diff --git a/engines/zvision/scripting/control.h b/engines/zvision/scripting/control.h
index 93ad5f5df1..6ec47c6455 100644
--- a/engines/zvision/scripting/control.h
+++ b/engines/zvision/scripting/control.h
@@ -39,14 +39,33 @@ class ZVision;
class Control {
public:
+
+ enum ControlType {
+ CONTROL_UNKNOW,
+ CONTROL_INPUT,
+ CONTROL_PUSHTGL,
+ CONTROL_SLOT,
+ CONTROL_LEVER,
+ CONTROL_SAVE,
+ CONTROL_SAFE,
+ CONTROL_FIST,
+ CONTROL_TITLER,
+ CONTROL_HOTMOV,
+ CONTROL_PAINT
+ };
+
Control() : _engine(0), _key(0) {}
- Control(ZVision *engine, uint32 key) : _engine(engine), _key(key) {}
+ Control(ZVision *engine, uint32 key, ControlType type) : _engine(engine), _key(key), _type(type) {}
virtual ~Control() {}
uint32 getKey() {
return _key;
}
+ ControlType getType() {
+ return _type;
+ }
+
virtual void focus() {}
virtual void unfocus() {}
/**
@@ -109,6 +128,8 @@ public:
static void parseFlatControl(ZVision *engine);
static void parsePanoramaControl(ZVision *engine, Common::SeekableReadStream &stream);
static void parseTiltControl(ZVision *engine, Common::SeekableReadStream &stream);
+private:
+ ControlType _type;
};
// TODO: Implement InputControl
diff --git a/engines/zvision/scripting/controls/input_control.cpp b/engines/zvision/scripting/controls/input_control.cpp
index ba1b634d42..0bca01bf47 100644
--- a/engines/zvision/scripting/controls/input_control.cpp
+++ b/engines/zvision/scripting/controls/input_control.cpp
@@ -38,7 +38,7 @@
namespace ZVision {
InputControl::InputControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
- : Control(engine, key),
+ : Control(engine, key, CONTROL_INPUT),
_nextTabstop(0),
_focused(false),
_textChanged(false),
diff --git a/engines/zvision/scripting/controls/lever_control.cpp b/engines/zvision/scripting/controls/lever_control.cpp
index 7e3ee775fb..87fbb433dd 100644
--- a/engines/zvision/scripting/controls/lever_control.cpp
+++ b/engines/zvision/scripting/controls/lever_control.cpp
@@ -42,7 +42,7 @@
namespace ZVision {
LeverControl::LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
- : Control(engine, key),
+ : Control(engine, key, CONTROL_LEVER),
_frameInfo(0),
_frameCount(0),
_startFrame(0),
diff --git a/engines/zvision/scripting/controls/push_toggle_control.cpp b/engines/zvision/scripting/controls/push_toggle_control.cpp
index 16cd971ad5..2f4af0d843 100644
--- a/engines/zvision/scripting/controls/push_toggle_control.cpp
+++ b/engines/zvision/scripting/controls/push_toggle_control.cpp
@@ -35,7 +35,7 @@
namespace ZVision {
PushToggleControl::PushToggleControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
- : Control(engine, key),
+ : Control(engine, key, CONTROL_PUSHTGL),
_countTo(2),
_event(Common::EVENT_LBUTTONUP) {
// Loop until we find the closing brace
diff --git a/engines/zvision/scripting/controls/slot_control.cpp b/engines/zvision/scripting/controls/slot_control.cpp
index c85b02b3cd..f78061ac13 100644
--- a/engines/zvision/scripting/controls/slot_control.cpp
+++ b/engines/zvision/scripting/controls/slot_control.cpp
@@ -36,7 +36,7 @@
namespace ZVision {
SlotControl::SlotControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
- : Control(engine, key) {
+ : Control(engine, key, CONTROL_SLOT) {
_rendered_item = 0;
_bkg = NULL;