aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2015-07-03 17:31:40 +0200
committerAlyssa Milburn2015-07-03 17:32:14 +0200
commit327899c7d214c418250f2fcc6481f12256fe190c (patch)
treed8c08055702e973d813531a3ac573e31e6414bec /engines
parent323a16e51c5925a07e9316ed69cc23a25401db16 (diff)
downloadscummvm-rg350-327899c7d214c418250f2fcc6481f12256fe190c.tar.gz
scummvm-rg350-327899c7d214c418250f2fcc6481f12256fe190c.tar.bz2
scummvm-rg350-327899c7d214c418250f2fcc6481f12256fe190c.zip
MOHAWK: Implement width/height for LB.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/livingbooks_code.cpp20
-rw-r--r--engines/mohawk/livingbooks_code.h2
2 files changed, 20 insertions, 2 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 6dcd8c3ce7..3b2941a6f4 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -852,8 +852,8 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
{ "resetDragParams", 0 },
{ "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ },
{ "setCursor", 0 },
- { "width", 0 },
- { "height", 0 },
+ { "width", &LBCode::cmdWidth },
+ { "height", &LBCode::cmdHeight },
{ "getFrameBounds", 0 }, // also "getFrameRect"
{ "traceRect", 0 },
{ "sqrt", 0 },
@@ -1131,6 +1131,22 @@ void LBCode::cmdRight(const Common::Array<LBValue> &params) {
_stack.push(rect.right);
}
+void LBCode::cmdWidth(const Common::Array<LBValue> &params) {
+ if (params.size() > 1)
+ error("too many parameters (%d) to width", params.size());
+
+ Common::Rect rect = getRectFromParams(params);
+ _stack.push(rect.width());
+}
+
+void LBCode::cmdHeight(const Common::Array<LBValue> &params) {
+ if (params.size() > 1)
+ error("too many parameters (%d) to height", params.size());
+
+ Common::Rect rect = getRectFromParams(params);
+ _stack.push(rect.height());
+}
+
void LBCode::cmdMove(const Common::Array<LBValue> &params) {
if (params.size() != 1 && params.size() != 2)
error("incorrect number of parameters (%d) to move", params.size());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index 080377ce99..b6b38b61fc 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -263,6 +263,8 @@ public:
void cmdLeft(const Common::Array<LBValue> &params);
void cmdBottom(const Common::Array<LBValue> &params);
void cmdRight(const Common::Array<LBValue> &params);
+ void cmdWidth(const Common::Array<LBValue> &params);
+ void cmdHeight(const Common::Array<LBValue> &params);
void cmdMove(const Common::Array<LBValue> &params);
void cmdSetDragParams(const Common::Array<LBValue> &params);
void cmdNewList(const Common::Array<LBValue> &params);