aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-20 16:31:27 +0100
committerAlyssa Milburn2011-11-20 16:32:23 +0100
commitc74b364b218d5fdf737685398a77a8ebaeb60c73 (patch)
tree738b9e9e06a0ca9639d7e48480f88aafbe4e515c
parent40474f0bc65796db591438ef236d0888398d5e65 (diff)
downloadscummvm-rg350-c74b364b218d5fdf737685398a77a8ebaeb60c73.tar.gz
scummvm-rg350-c74b364b218d5fdf737685398a77a8ebaeb60c73.tar.bz2
scummvm-rg350-c74b364b218d5fdf737685398a77a8ebaeb60c73.zip
MOHAWK: Implement LB's makePt.
-rw-r--r--engines/mohawk/livingbooks_code.cpp8
-rw-r--r--engines/mohawk/livingbooks_code.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 80b5fe9660..00b07dffff 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -692,7 +692,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
{ "min", 0 },
{ "abs", 0 },
{ "getRect", &LBCode::cmdGetRect }, // also "makeRect"
- { "makePt", 0 }, // also "makePair"
+ { "makePt", &LBCode::cmdMakePoint }, // also "makePair"
{ "topLeft", &LBCode::cmdTopLeft },
{ "bottomRight", &LBCode::cmdBottomRight },
{ "mousePos", 0 },
@@ -899,6 +899,12 @@ void LBCode::cmdGetRect(const Common::Array<LBValue> &params) {
error("incorrect number of parameters (%d) to getRect", params.size());
}
+void LBCode::cmdMakePoint(const Common::Array<LBValue> &params) {
+ if (params.size() != 2)
+ error("incorrect number of parameters (%d) to makePoint", params.size());
+ _stack.push(Common::Point(params[0].toInt(), params[1].toInt()));
+}
+
void LBCode::cmdTopLeft(const Common::Array<LBValue> &params) {
if (params.size() > 1)
error("too many parameters (%d) to topLeft", params.size());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index 79c9af94f7..84ea66a4c7 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -225,6 +225,7 @@ public:
void cmdStringLen(const Common::Array<LBValue> &params);
void cmdSubstring(const Common::Array<LBValue> &params);
void cmdGetRect(const Common::Array<LBValue> &params);
+ void cmdMakePoint(const Common::Array<LBValue> &params);
void cmdTopLeft(const Common::Array<LBValue> &params);
void cmdBottomRight(const Common::Array<LBValue> &params);
void cmdTop(const Common::Array<LBValue> &params);