diff options
author | Alyssa Milburn | 2011-12-01 23:52:47 +0100 |
---|---|---|
committer | Alyssa Milburn | 2011-12-01 23:52:47 +0100 |
commit | 553d32a81808844eefbb603fb09adff7e96234ef (patch) | |
tree | a1b71532bd363fe933d952447fe5e9e2f9982f1a | |
parent | d015a37e00b5c3c1ca03ee04bd523730cd5ace05 (diff) | |
download | scummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.tar.gz scummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.tar.bz2 scummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.zip |
MOHAWK: Implement LBCode::cmdMousePos.
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 11 | ||||
-rw-r--r-- | engines/mohawk/livingbooks_code.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index be4173f67d..caf00c7129 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -24,6 +24,7 @@ #include "mohawk/livingbooks_lbx.h" #include "mohawk/resource.h" +#include "common/events.h" #include "common/system.h" #include "common/textconsole.h" @@ -751,7 +752,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "makePt", &LBCode::cmdMakePoint }, // also "makePair" { "topLeft", &LBCode::cmdTopLeft }, { "bottomRight", &LBCode::cmdBottomRight }, - { "mousePos", 0 }, + { "mousePos", &LBCode::cmdMousePos }, { "top", &LBCode::cmdTop }, { "left", &LBCode::cmdLeft }, { "bottom", &LBCode::cmdBottom }, @@ -1006,6 +1007,14 @@ void LBCode::cmdBottomRight(const Common::Array<LBValue> ¶ms) { _stack.push(Common::Point(rect.bottom, rect.right)); } +void LBCode::cmdMousePos(const Common::Array<LBValue> ¶ms) { + if (params.size() != 0) + error("too many parameters (%d) to mousePos", params.size()); + + Common::Point pt = _vm->_system->getEventManager()->getMousePos(); + _stack.push(pt); +} + void LBCode::cmdTop(const Common::Array<LBValue> ¶ms) { if (params.size() > 1) error("too many parameters (%d) to top", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index e866fca0b4..973a674fdd 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -257,6 +257,7 @@ public: void cmdMakePoint(const Common::Array<LBValue> ¶ms); void cmdTopLeft(const Common::Array<LBValue> ¶ms); void cmdBottomRight(const Common::Array<LBValue> ¶ms); + void cmdMousePos(const Common::Array<LBValue> ¶ms); void cmdTop(const Common::Array<LBValue> ¶ms); void cmdLeft(const Common::Array<LBValue> ¶ms); void cmdBottom(const Common::Array<LBValue> ¶ms); |