[Scummvm-cvs-logs] scummvm master -> 3ed095434f471d1cecde2f8c2c805f7d22aed572
fuzzie
fuzzie at fuzzie.org
Fri May 13 23:05:43 CEST 2011
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
15856a1843 MOHAWK: Add basic LBProxyItem support.
80249e3445 MOHAWK: Add/improve LB debug output a little.
3ed095434f MOHAWK: Stub another two LB script functions.
Commit: 15856a18439fc8652e41c6b7a5ca9d2ab5d0b283
https://github.com/scummvm/scummvm/commit/15856a18439fc8652e41c6b7a5ca9d2ab5d0b283
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-05-13T14:02:06-07:00
Commit Message:
MOHAWK: Add basic LBProxyItem support.
Changed paths:
engines/mohawk/livingbooks.cpp
engines/mohawk/livingbooks.h
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 1fb9f4a..f917113 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -743,6 +743,9 @@ void LBPage::loadBITL(uint16 resourceId) {
case kLBMiniGameItem:
res = new LBMiniGameItem(_vm, this, rect);
break;
+ case kLBProxyItem:
+ res = new LBProxyItem(_vm, this, rect);
+ break;
default:
warning("Unknown item type %04x", type);
case 3: // often used for buttons
@@ -3745,4 +3748,35 @@ bool LBMiniGameItem::togglePlaying(bool playing, bool restart) {
return false;
}
+LBProxyItem::LBProxyItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) {
+ debug(3, "new LBProxyItem");
+
+ _page = NULL;
+}
+
+LBProxyItem::~LBProxyItem() {
+ delete _page;
+}
+
+void LBProxyItem::init() {
+ Common::String leftover;
+ Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover);
+ if (!leftover.empty())
+ error("LBProxyItem tried loading proxy '%s' but got leftover '%s'", _desc.c_str(), leftover.c_str());
+ uint16 baseId;
+ for (uint i = 0; i < filename.size(); i++) {
+ if (filename[i] == ';') {
+ baseId = atoi(filename.c_str() + i + 1);
+ filename = Common::String(filename.c_str(), i);
+ }
+ }
+
+ debug(1, "LBProxyItem loading archive '%s' with id %d", filename.c_str(), baseId);
+ MohawkArchive *pageArchive = _vm->createMohawkArchive();
+ if (!pageArchive->open(filename))
+ error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str());
+ _page = new LBPage(_vm);
+ _page->open(pageArchive, baseId);
+}
+
} // End of namespace Mohawk
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 81a049c..de84b0f 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -571,6 +571,17 @@ public:
bool togglePlaying(bool playing, bool restart);
};
+class LBProxyItem : public LBItem {
+public:
+ LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect);
+ ~LBProxyItem();
+
+ void init();
+
+protected:
+ class LBPage *_page;
+};
+
struct NotifyEvent {
NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { }
uint type;
Commit: 80249e34455320afc0ac3db4f8e78c803dd5b5ab
https://github.com/scummvm/scummvm/commit/80249e34455320afc0ac3db4f8e78c803dd5b5ab
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-05-13T14:02:44-07:00
Commit Message:
MOHAWK: Add/improve LB debug output a little.
Changed paths:
engines/mohawk/livingbooks.cpp
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index f917113..36d86fb 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -290,6 +290,15 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) {
// - fUse254ColorPalette (always true?)
// - nKBRequired (4096, RAM requirement?)
// - fDebugWindow (always 0?)
+
+ if (_bookInfoFile.hasSection("Globals")) {
+ 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
+ }
+ }
}
Common::String MohawkEngine_LivingBooks::stringForMode(LBMode mode) {
@@ -2700,10 +2709,20 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) {
break;
case kLBOpLoad:
+ // FIXME
+ warning("ignoring kLBOpLoad (event 0x%04x, param 0x%04x, target '%s')",
+ entry->event, entry->param, target->_desc.c_str());
+ break;
+
case kLBOpPreload:
+ // FIXME
+ warning("ignoring kLBOpPreload (event 0x%04x, param 0x%04x, target '%s')",
+ entry->event, entry->param, target->_desc.c_str());
+ break;
+
case kLBOpUnload:
// FIXME
- warning("ignoring kLBOpLoad/Preload/Unload (event 0x%04x, param 0x%04x, target '%s')",
+ warning("ignoring kLBOpUnload (event 0x%04x, param 0x%04x, target '%s')",
entry->event, entry->param, target->_desc.c_str());
break;
Commit: 3ed095434f471d1cecde2f8c2c805f7d22aed572
https://github.com/scummvm/scummvm/commit/3ed095434f471d1cecde2f8c2c805f7d22aed572
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-05-13T14:03:47-07:00
Commit Message:
MOHAWK: Stub another two LB script functions.
Changed paths:
engines/mohawk/livingbooks_code.cpp
engines/mohawk/livingbooks_code.h
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 1cc8aea..165ca4a 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -606,7 +606,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = {
{ "move", 0 },
{ 0, 0 },
{ 0, 0 },
- { "setDragParams", 0 },
+ { "setDragParams", &LBCode::cmdSetDragParams },
{ "resetDragParams", 0 },
{ "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ },
{ "setCursor", 0 },
@@ -801,6 +801,10 @@ void LBCode::cmdRight(const Common::Array<LBValue> ¶ms) {
_stack.push(rect.right);
}
+void LBCode::cmdSetDragParams(const Common::Array<LBValue> ¶ms) {
+ warning("ignoring setDragParams");
+}
+
void LBCode::cmdSetPlayParams(const Common::Array<LBValue> ¶ms) {
if (params.size() > 8)
error("too many parameters (%d) to setPlayParams", params.size());
@@ -875,7 +879,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = {
{ "isLoaded", 0 },
{ "isDragging", 0 },
{ "load", 0 },
- { "moveTo", 0 },
+ { "moveTo", &LBCode::itemMoveTo },
{ "mute", 0 },
{ "play", 0 },
{ "seek", 0 },
@@ -910,6 +914,10 @@ void LBCode::itemIsPlaying(const Common::Array<LBValue> ¶ms) {
_stack.push(0);
}
+void LBCode::itemMoveTo(const Common::Array<LBValue> ¶ms) {
+ warning("ignoring moveTo");
+}
+
void LBCode::itemSetParent(const Common::Array<LBValue> ¶ms) {
if (params.size() > 2)
error("incorrect number of parameters (%d) to setParent", params.size());
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index d64ce5a..9602e2d 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -222,12 +222,14 @@ public:
void cmdLeft(const Common::Array<LBValue> ¶ms);
void cmdBottom(const Common::Array<LBValue> ¶ms);
void cmdRight(const Common::Array<LBValue> ¶ms);
+ void cmdSetDragParams(const Common::Array<LBValue> ¶ms);
void cmdSetPlayParams(const Common::Array<LBValue> ¶ms);
void cmdSetKeyEvent(const Common::Array<LBValue> ¶ms);
void cmdSetHitTest(const Common::Array<LBValue> ¶ms);
void cmdKey(const Common::Array<LBValue> ¶ms);
void itemSetParent(const Common::Array<LBValue> ¶ms);
+ void itemMoveTo(const Common::Array<LBValue> ¶ms);
void itemIsPlaying(const Common::Array<LBValue> ¶ms);
};
More information about the Scummvm-git-logs
mailing list