[Scummvm-cvs-logs] scummvm master -> 89b1ff3dc350f49ded2514176a70bceae702cf4b
fuzzie
fuzzie at fuzzie.org
Sat Nov 26 20:51:20 CET 2011
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
581aca66fa MOHAWK: Parse true/false in LB scripts.
4466b6556a MOHAWK: Start the LB load phase at load time.
285a92ffaa MOHAWK: Handle globals from the LB book info file.
89b1ff3dc3 MOHAWK: Run kLBEventInit at init time.
Commit: 581aca66fa95b9fad693db22e0df5e626b63d80c
https://github.com/scummvm/scummvm/commit/581aca66fa95b9fad693db22e0df5e626b63d80c
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-26T11:49:02-08:00
Commit Message:
MOHAWK: Parse true/false in LB scripts.
Changed paths:
engines/mohawk/livingbooks_code.cpp
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index c0c03e0..28cf477 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -1419,7 +1419,13 @@ uint LBCode::parseCode(const Common::String &source) {
break;
tempString += source[pos++];
}
- wasFunction = parseCodeSymbol(tempString, pos, code);
+ if (tempString.equalsIgnoreCase("true")) {
+ code.push_back(kTokenTrue);
+ } else if (tempString.equalsIgnoreCase("false")) {
+ code.push_back(kTokenFalse);
+ } else {
+ wasFunction = parseCodeSymbol(tempString, pos, code);
+ }
} else {
error("while parsing script '%s', couldn't parse '%c'", source.c_str(), token);
}
Commit: 4466b6556a57bd9e43f0690203cfdd0ccdfa2e04
https://github.com/scummvm/scummvm/commit/4466b6556a57bd9e43f0690203cfdd0ccdfa2e04
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-26T11:49:02-08:00
Commit Message:
MOHAWK: Start the LB load phase at load time.
Changed paths:
engines/mohawk/livingbooks.cpp
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 14ee031..e8232f2 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -102,6 +102,9 @@ void LBPage::open(Archive *mhk, uint16 baseId) {
for (uint32 i = 0; i < _items.size(); i++)
_items[i]->init();
+
+ for (uint32 i = 0; i < _items.size(); i++)
+ _items[i]->startPhase(0xFFFE);
}
void LBPage::itemDestroyed(LBItem *item) {
@@ -438,9 +441,6 @@ void MohawkEngine_LivingBooks::updatePage() {
switch (_phase) {
case 0:
for (uint32 i = 0; i < _items.size(); i++)
- _items[i]->startPhase(0xFFFE);
-
- for (uint32 i = 0; i < _items.size(); i++)
_items[i]->startPhase(0xFFFF);
for (uint32 i = 0; i < _items.size(); i++)
Commit: 285a92ffaafe4e34ef37607e86aa54a3b382475e
https://github.com/scummvm/scummvm/commit/285a92ffaafe4e34ef37607e86aa54a3b382475e
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-26T11:49:02-08:00
Commit Message:
MOHAWK: Handle globals from the LB book info file.
Changed paths:
engines/mohawk/livingbooks.cpp
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index e8232f2..08b67de 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -307,8 +307,9 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) {
const Common::ConfigFile::SectionKeyList globals = _bookInfoFile.getKeys("Globals");
for (Common::ConfigFile::SectionKeyList::const_iterator i = globals.begin(); i != globals.end(); i++) {
Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str());
- debug("global: %s", command.c_str());
- // TODO: run command
+ LBCode tempCode(this, 0);
+ uint offset = tempCode.parseCode(command);
+ tempCode.runCode(NULL, offset);
}
}
}
Commit: 89b1ff3dc350f49ded2514176a70bceae702cf4b
https://github.com/scummvm/scummvm/commit/89b1ff3dc350f49ded2514176a70bceae702cf4b
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-26T11:49:02-08:00
Commit Message:
MOHAWK: Run kLBEventInit at init time.
Changed paths:
engines/mohawk/livingbooks.cpp
engines/mohawk/livingbooks.h
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 08b67de..ca3e37b 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2520,6 +2520,10 @@ void LBItem::done(bool onlyNotify) {
notify(0xFFFF, _itemId);
}
+void LBItem::init() {
+ runScript(kLBEventInit);
+}
+
void LBItem::setVisible(bool visible) {
if (visible == _visible)
return;
@@ -3506,6 +3510,8 @@ bool LBPictureItem::contains(Common::Point point) {
void LBPictureItem::init() {
_vm->_gfx->preloadImage(_resourceId);
+
+ LBItem::init();
}
void LBPictureItem::draw() {
@@ -3583,6 +3589,8 @@ void LBAnimationItem::done(bool onlyNotify) {
void LBAnimationItem::init() {
_anim = new LBAnimation(_vm, this, _resourceId);
+
+ LBItem::init();
}
void LBAnimationItem::stop() {
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index e2acb58..975a5f9 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -391,7 +391,7 @@ public:
virtual void handleMouseUp(Common::Point pos); // 0xD
virtual bool togglePlaying(bool playing, bool restart = false); // 0xF
virtual void done(bool onlyNotify); // 0x10
- virtual void init() { } // 0x11
+ virtual void init(); // 0x11
virtual void seek(uint16 pos) { } // 0x13
virtual void setFocused(bool focused) { } // 0x14
virtual void setVisible(bool visible); // 0x17
More information about the Scummvm-git-logs
mailing list