Skip to content

Commit

Permalink
MOHAWK: Add LBCode::resolveItem helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Jul 1, 2011
1 parent 689099f commit 2667b50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions engines/mohawk/livingbooks_code.cpp
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions engines/mohawk/livingbooks_code.h
Expand Up @@ -206,6 +206,7 @@ class LBCode {
void parseArithmetic2();
void parseMain();

LBItem *resolveItem(const LBValue &value);
Common::Array<LBValue> readParams();
Common::Rect getRectFromParams(const Common::Array<LBValue> &params);

Expand Down

0 comments on commit 2667b50

Please sign in to comment.