diff options
author | Alyssa Milburn | 2011-07-02 00:04:24 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-02 00:04:24 +0200 |
commit | 2667b502d790c640e0f6a71b21857333134b9a41 (patch) | |
tree | f9edf93d838d0a3d7425a6588505eb13f8d07a01 /engines/mohawk | |
parent | 689099f9b5d93e901f4adcc24c63f7a377a33fdb (diff) | |
download | scummvm-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.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); |