[Scummvm-cvs-logs] scummvm master -> 327899c7d214c418250f2fcc6481f12256fe190c
fuzzie
fuzzie at fuzzie.org
Fri Jul 3 17:33:45 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
327899c7d2 MOHAWK: Implement width/height for LB.
Commit: 327899c7d214c418250f2fcc6481f12256fe190c
https://github.com/scummvm/scummvm/commit/327899c7d214c418250f2fcc6481f12256fe190c
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2015-07-03T17:32:14+02:00
Commit Message:
MOHAWK: Implement width/height for LB.
Changed paths:
engines/mohawk/livingbooks_code.cpp
engines/mohawk/livingbooks_code.h
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 6dcd8c3..3b2941a 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> ¶ms) {
_stack.push(rect.right);
}
+void LBCode::cmdWidth(const Common::Array<LBValue> ¶ms) {
+ 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> ¶ms) {
+ 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> ¶ms) {
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 080377c..b6b38b6 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -263,6 +263,8 @@ public:
void cmdLeft(const Common::Array<LBValue> ¶ms);
void cmdBottom(const Common::Array<LBValue> ¶ms);
void cmdRight(const Common::Array<LBValue> ¶ms);
+ void cmdWidth(const Common::Array<LBValue> ¶ms);
+ void cmdHeight(const Common::Array<LBValue> ¶ms);
void cmdMove(const Common::Array<LBValue> ¶ms);
void cmdSetDragParams(const Common::Array<LBValue> ¶ms);
void cmdNewList(const Common::Array<LBValue> ¶ms);
More information about the Scummvm-git-logs
mailing list