diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 20 | ||||
-rw-r--r-- | engines/mohawk/livingbooks_code.h | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 298569c050..c9a117187c 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -842,8 +842,8 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "bottom", &LBCode::cmdBottom }, // 0x10 { "right", &LBCode::cmdRight }, - { "xpos", 0 }, - { "ypos", 0 }, + { "xpos", &LBCode::cmdXPos }, + { "ypos", &LBCode::cmdYPos }, { "playFrom", 0 }, { "move", &LBCode::cmdMove }, { 0, 0 }, @@ -1131,6 +1131,22 @@ void LBCode::cmdRight(const Common::Array<LBValue> ¶ms) { _stack.push(rect.right); } +void LBCode::cmdXPos(const Common::Array<LBValue> ¶ms) { + if (params.size() != 1) + error("too many parameters (%d) to xpos", params.size()); + + Common::Point point = params[0].toPoint(); + _stack.push(point.x); +} + +void LBCode::cmdYPos(const Common::Array<LBValue> ¶ms) { + if (params.size() != 1) + error("too many parameters (%d) to ypos", params.size()); + + Common::Point point = params[0].toPoint(); + _stack.push(point.y); +} + void LBCode::cmdWidth(const Common::Array<LBValue> ¶ms) { if (params.size() > 1) error("too many parameters (%d) to width", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index c9d62ff799..6f6297d592 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -263,6 +263,8 @@ public: void cmdLeft(const Common::Array<LBValue> ¶ms); void cmdBottom(const Common::Array<LBValue> ¶ms); void cmdRight(const Common::Array<LBValue> ¶ms); + void cmdXPos(const Common::Array<LBValue> ¶ms); + void cmdYPos(const Common::Array<LBValue> ¶ms); void cmdWidth(const Common::Array<LBValue> ¶ms); void cmdHeight(const Common::Array<LBValue> ¶ms); void cmdMove(const Common::Array<LBValue> ¶ms); |