MOHAWK: Implement LBCode::itemIsLoaded.

This commit is contained in:
Alyssa Milburn 2011-12-02 00:03:01 +01:00
parent 9b00b3d5b7
commit 82ff40c548
3 changed files with 14 additions and 1 deletions

View File

@ -410,6 +410,7 @@ public:
const Common::String &getName() { return _desc; }
const Common::Rect &getRect() { return _rect; }
uint16 getSoundPriority() { return _soundMode; }
bool isLoaded() { return _loaded; }
bool isAmbient() { return _isAmbient; }
Common::List<LBItem *>::iterator _iterator;

View File

@ -1246,7 +1246,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = {
{ "isMuted", 0 },
{ "isPlaying", &LBCode::itemIsPlaying },
{ "isVisible", 0 },
{ "isLoaded", 0 },
{ "isLoaded", &LBCode::itemIsLoaded },
{ "isDragging", 0 },
{ "load", 0 },
{ "moveTo", &LBCode::itemMoveTo },
@ -1284,6 +1284,17 @@ void LBCode::itemIsPlaying(const Common::Array<LBValue> &params) {
_stack.push(0);
}
void LBCode::itemIsLoaded(const Common::Array<LBValue> &params) {
if (params.size() != 1)
error("incorrect number of parameters (%d) to isLoaded", params.size());
LBItem *item = resolveItem(params[0]);
if (!item || !item->isLoaded())
_stack.push(0);
else
_stack.push(1);
}
void LBCode::itemMoveTo(const Common::Array<LBValue> &params) {
if (params.size() != 1 && params.size() != 2)
error("incorrect number of parameters (%d) to moveTo", params.size());

View File

@ -275,6 +275,7 @@ public:
void cmdKey(const Common::Array<LBValue> &params);
void itemIsPlaying(const Common::Array<LBValue> &params);
void itemIsLoaded(const Common::Array<LBValue> &params);
void itemMoveTo(const Common::Array<LBValue> &params);
void itemSeek(const Common::Array<LBValue> &params);
void itemSeekToFrame(const Common::Array<LBValue> &params);