diff options
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 10 | ||||
-rw-r--r-- | engines/mohawk/livingbooks_code.h | 1 |
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> ¶ms); |