aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-12-02 00:03:01 +0100
committerAlyssa Milburn2011-12-02 00:03:01 +0100
commit82ff40c5485f381e15d22b6bc274cd1c49846fd6 (patch)
treedb05a200e8937451e2c64e4ce93ab484e2014327
parent9b00b3d5b745801241a6d9b9e1383413e0c85ba6 (diff)
downloadscummvm-rg350-82ff40c5485f381e15d22b6bc274cd1c49846fd6.tar.gz
scummvm-rg350-82ff40c5485f381e15d22b6bc274cd1c49846fd6.tar.bz2
scummvm-rg350-82ff40c5485f381e15d22b6bc274cd1c49846fd6.zip
MOHAWK: Implement LBCode::itemIsLoaded.
-rw-r--r--engines/mohawk/livingbooks.h1
-rw-r--r--engines/mohawk/livingbooks_code.cpp13
-rw-r--r--engines/mohawk/livingbooks_code.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index e79d134017..28dd49e78a 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -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;
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 86f5a06178..138f35bbd3 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -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());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index ee61c2add2..2e9153f53b 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -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);