diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/archive.cpp | 7 | ||||
-rw-r--r-- | engines/director/archive.h | 4 | ||||
-rw-r--r-- | engines/director/resource.cpp | 14 | ||||
-rw-r--r-- | engines/director/score.cpp | 4 |
4 files changed, 25 insertions, 4 deletions
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp index 593fb638e4..496f47cc23 100644 --- a/engines/director/archive.cpp +++ b/engines/director/archive.cpp @@ -66,10 +66,13 @@ void Archive::close() { _stream = 0; } -bool Archive::hasResource(uint32 tag, uint16 id) const { +bool Archive::hasResource(uint32 tag, int id) const { if (!_types.contains(tag)) return false; + if (id == -1) + return true; + return _types[tag].contains(id); } @@ -408,7 +411,7 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff keyRes = &resources[resources.size() - 1]; else if (tag == MKTAG('C', 'A', 'S', '*')) casRes = &resources[resources.size() - 1]; - //or the children of + //or the children of else if (tag == MKTAG('S', 'T', 'X', 'T') || tag == MKTAG('B', 'I', 'T', 'D') || tag == MKTAG('D', 'I', 'B', ' ')) diff --git a/engines/director/archive.h b/engines/director/archive.h index b77bace9ba..40b15d51dc 100644 --- a/engines/director/archive.h +++ b/engines/director/archive.h @@ -33,7 +33,7 @@ class MacResManager; namespace Director { // Completely ripped off of Mohawk's Archive code - + struct Resource { uint32 index; uint32 offset; @@ -56,7 +56,7 @@ public: bool isOpen() const { return _stream != 0; } - bool hasResource(uint32 tag, uint16 id) const; + bool hasResource(uint32 tag, int id) const; bool hasResource(uint32 tag, const Common::String &resName) const; virtual Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id); virtual Resource getResourceDetail(uint32 tag, uint16 id); diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 8bb4e82bcf..f2a44d5e69 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -21,6 +21,8 @@ */ #include "common/macresman.h" +#include "graphics/macgui/macwindowmanager.h" +#include "graphics/macgui/macfontmanager.h" #include "director/director.h" #include "director/archive.h" @@ -214,6 +216,18 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) { Score *castScore = new Score(this, shardcst); + if (shardcst->hasResource(MKTAG('F', 'O', 'N', 'D'), -1)) { + debug("Shared cast has fonts. Loading...."); + + Common::File file; + + if (!file.open(filename)) { + warning("Oops, cannot open file"); + } else { + _wm->_fontMan->loadFontsFromStream(&file); + } + } + castScore->loadConfig(*shardcst->getResource(MKTAG('V','W','C','F'), 1024)); if (getVersion() < 4) diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 18ab4c9050..778f715901 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -198,6 +198,10 @@ void Score::loadArchive() { g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount()); } + if (_movieArchive->hasResource(MKTAG('F', 'O', 'N', 'D'), -1)) { + debug("Movie has fonts. Loading...."); + } + assert(_movieArchive->hasResource(MKTAG('V', 'W', 'S', 'C'), 1024)); assert(_movieArchive->hasResource(MKTAG('V', 'W', 'C', 'F'), 1024)); |