aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-07-02 00:04:24 +0200
committerAlyssa Milburn2011-07-02 00:04:24 +0200
commit2667b502d790c640e0f6a71b21857333134b9a41 (patch)
treef9edf93d838d0a3d7425a6588505eb13f8d07a01 /engines/mohawk
parent689099f9b5d93e901f4adcc24c63f7a377a33fdb (diff)
downloadscummvm-rg350-2667b502d790c640e0f6a71b21857333134b9a41.tar.gz
scummvm-rg350-2667b502d790c640e0f6a71b21857333134b9a41.tar.bz2
scummvm-rg350-2667b502d790c640e0f6a71b21857333134b9a41.zip
MOHAWK: Add LBCode::resolveItem helper function.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks_code.cpp10
-rw-r--r--engines/mohawk/livingbooks_code.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 96345ad845..d091f95a15 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -555,6 +555,16 @@ void LBCode::parseMain() {
}
}
+LBItem *LBCode::resolveItem(const LBValue &value) {
+ if (value.type == kLBValueItemPtr)
+ return value.item;
+ if (value.type == kLBValueString)
+ return _vm->getItemByName(value.string);
+ if (value.type == kLBValueInteger)
+ return _vm->getItemById(value.integer);
+ return NULL;
+}
+
Common::Array<LBValue> LBCode::readParams() {
Common::Array<LBValue> params;
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index 9602e2d22d..3e33549b4d 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -206,6 +206,7 @@ protected:
void parseArithmetic2();
void parseMain();
+ LBItem *resolveItem(const LBValue &value);
Common::Array<LBValue> readParams();
Common::Rect getRectFromParams(const Common::Array<LBValue> &params);