Skip to content

Commit

Permalink
ZVISION: Controls now can return type of control.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Jul 12, 2014
1 parent b9103b8 commit 57857a1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
23 changes: 22 additions & 1 deletion engines/zvision/scripting/control.h
Expand Up @@ -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() {}
/**
Expand Down Expand Up @@ -109,6 +128,8 @@ class Control {
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
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/controls/input_control.cpp
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/controls/lever_control.cpp
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/controls/push_toggle_control.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/controls/slot_control.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 57857a1

Please sign in to comment.