diff options
Diffstat (limited to 'engines/mohawk/livingbooks_code.cpp')
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 20 |
1 files changed, 18 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()); |