[Scummvm-cvs-logs] scummvm master -> 273f4ae9458069b5a2057e670ad093079c724f77
fuzzie
fuzzie at fuzzie.org
Fri Jul 3 17:44:36 CEST 2015
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
97fcc16a4d MOHAWK: Implement deleteVar for LB.
273f4ae945 MOHAWK: Implement xpos/ypos for LB.
Commit: 97fcc16a4dd2ed00bb0ed4460d9abadb7de8ac52
https://github.com/scummvm/scummvm/commit/97fcc16a4dd2ed00bb0ed4460d9abadb7de8ac52
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2015-07-03T17:38:00+02:00
Commit Message:
MOHAWK: Implement deleteVar 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 3b2941a..298569c 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -858,7 +858,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
{ "traceRect", 0 },
{ "sqrt", 0 },
// 0x20
- { "deleteVar", 0 },
+ { "deleteVar", &LBCode::cmdDeleteVar },
{ "saveVars", 0 },
{ "scriptLink", 0 },
{ "setViewOrigin", &LBCode::cmdUnimplemented },
@@ -1279,6 +1279,14 @@ void LBCode::cmdGetProperty(const Common::Array<LBValue> ¶ms) {
_stack.push(target->_variables[name]);
}
+void LBCode::cmdDeleteVar(const Common::Array<LBValue> ¶ms) {
+ if (params.size() != 1)
+ error("incorrect number of parameters (%d) to deleteVar", params.size());
+
+ const Common::String &string = params[0].toString();
+ _vm->_variables.erase(string);
+}
+
void LBCode::cmdExec(const Common::Array<LBValue> ¶ms) {
if (params.size() != 1)
error("incorrect number of parameters (%d) to exec", params.size());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index b6b38b6..c9d62ff 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -275,6 +275,7 @@ public:
void cmdDeleteAt(const Common::Array<LBValue> ¶ms);
void cmdSetProperty(const Common::Array<LBValue> ¶ms);
void cmdGetProperty(const Common::Array<LBValue> ¶ms);
+ void cmdDeleteVar(const Common::Array<LBValue> ¶ms);
void cmdExec(const Common::Array<LBValue> ¶ms);
void cmdReturn(const Common::Array<LBValue> ¶ms);
void cmdSetPlayParams(const Common::Array<LBValue> ¶ms);
Commit: 273f4ae9458069b5a2057e670ad093079c724f77
https://github.com/scummvm/scummvm/commit/273f4ae9458069b5a2057e670ad093079c724f77
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2015-07-03T17:42:48+02:00
Commit Message:
MOHAWK: Implement xpos/ypos 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 298569c..c9a1171 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -842,8 +842,8 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
{ "bottom", &LBCode::cmdBottom },
// 0x10
{ "right", &LBCode::cmdRight },
- { "xpos", 0 },
- { "ypos", 0 },
+ { "xpos", &LBCode::cmdXPos },
+ { "ypos", &LBCode::cmdYPos },
{ "playFrom", 0 },
{ "move", &LBCode::cmdMove },
{ 0, 0 },
@@ -1131,6 +1131,22 @@ void LBCode::cmdRight(const Common::Array<LBValue> ¶ms) {
_stack.push(rect.right);
}
+void LBCode::cmdXPos(const Common::Array<LBValue> ¶ms) {
+ if (params.size() != 1)
+ error("too many parameters (%d) to xpos", params.size());
+
+ Common::Point point = params[0].toPoint();
+ _stack.push(point.x);
+}
+
+void LBCode::cmdYPos(const Common::Array<LBValue> ¶ms) {
+ if (params.size() != 1)
+ error("too many parameters (%d) to ypos", params.size());
+
+ Common::Point point = params[0].toPoint();
+ _stack.push(point.y);
+}
+
void LBCode::cmdWidth(const Common::Array<LBValue> ¶ms) {
if (params.size() > 1)
error("too many parameters (%d) to width", params.size());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index c9d62ff..6f6297d 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 cmdXPos(const Common::Array<LBValue> ¶ms);
+ void cmdYPos(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);
More information about the Scummvm-git-logs
mailing list