aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-12-01 23:52:47 +0100
committerAlyssa Milburn2011-12-01 23:52:47 +0100
commit553d32a81808844eefbb603fb09adff7e96234ef (patch)
treea1b71532bd363fe933d952447fe5e9e2f9982f1a /engines/mohawk
parentd015a37e00b5c3c1ca03ee04bd523730cd5ace05 (diff)
downloadscummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.tar.gz
scummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.tar.bz2
scummvm-rg350-553d32a81808844eefbb603fb09adff7e96234ef.zip
MOHAWK: Implement LBCode::cmdMousePos.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks_code.cpp11
-rw-r--r--engines/mohawk/livingbooks_code.h1
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> &params) {
_stack.push(Common::Point(rect.bottom, rect.right));
}
+void LBCode::cmdMousePos(const Common::Array<LBValue> &params) {
+ 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> &params) {
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> &params);
void cmdTopLeft(const Common::Array<LBValue> &params);
void cmdBottomRight(const Common::Array<LBValue> &params);
+ void cmdMousePos(const Common::Array<LBValue> &params);
void cmdTop(const Common::Array<LBValue> &params);
void cmdLeft(const Common::Array<LBValue> &params);
void cmdBottom(const Common::Array<LBValue> &params);