aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDmitry Iskrich2016-06-28 20:33:14 +0300
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit4b871b62e5fea82517301c7377118244420723d7 (patch)
tree5ca6456a36b370b4c00780107b5f0c0463a54416 /engines
parent038a3ca29392b61f7286302c70f948fde161c126 (diff)
downloadscummvm-rg350-4b871b62e5fea82517301c7377118244420723d7.tar.gz
scummvm-rg350-4b871b62e5fea82517301c7377118244420723d7.tar.bz2
scummvm-rg350-4b871b62e5fea82517301c7377118244420723d7.zip
DIRECTOR: Renew shared resources when loading new folder
Diffstat (limited to 'engines')
-rw-r--r--engines/director/director.cpp16
-rw-r--r--engines/director/director.h4
-rw-r--r--engines/director/score.cpp2
3 files changed, 21 insertions, 1 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index af0f87bd19..0c63525c53 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -56,6 +56,8 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_mainArchive = 0;
_macBinary = 0;
_currentPalette = 0;
+ //FIXME
+ _sharedMMM = "SHARDCST.MMM";
_movies = new Common::HashMap<Common::String, Score *>();
const Common::FSNode gameDataDir(ConfMan.get("path"));
@@ -210,6 +212,11 @@ Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::St
if (!movies.empty()) {
for (Common::FSList::const_iterator i = movies.begin(); i != movies.end(); ++i) {
+ if (i->getName() == _sharedMMM) {
+ loadSharedCastsFrom(i->getPath());
+ continue;
+ }
+
RIFFArchive *arc = new RIFFArchive();
arc->openFile(i->getPath());
Score *sc = new Score(this);
@@ -402,6 +409,15 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
_sharedSTXT[*iterator] = shardcst->getResource(MKTAG('S','T','X','T'), *iterator);
}
}
+
+ Common::Array<uint16> sound = shardcst->getResourceIDList(MKTAG('S','N','D',' '));
+
+ if (stxt.size() != 0) {
+ Common::Array<uint16>::iterator iterator;
+ for (iterator = sound.begin(); iterator != sound.end(); ++iterator) {
+ _sharedSTXT[*iterator] = shardcst->getResource(MKTAG('S','N','D',' '), *iterator);
+ }
+ }
}
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index 0e76cd9ea8..82c43fd90c 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -91,9 +91,13 @@ private:
void loadMac();
Common::String readPascalString(Common::SeekableReadStream &stream);
+
+ Common::String _sharedMMM;
Common::HashMap<int, Cast *> _sharedCasts;
Common::HashMap<int, Common::SeekableReadStream *> _sharedDIB;
Common::HashMap<int, Common::SeekableReadStream *> _sharedSTXT;
+ Common::HashMap<int, Common::SeekableReadStream *> _sharedSound;
+
Archive *_mainArchive;
Common::MacResManager *_macBinary;
DirectorSound *_soundManager;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b334caf2bf..7b26a952e2 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -676,7 +676,7 @@ void Score::update() {
Common::SortedArray<Label *>::iterator i;
for (i = _labels->begin(); i != _labels->end(); ++i) {
- if ((*i)->number = _currentFrame) {
+ if ((*i)->number == _currentFrame) {
_currentLabel = (*i)->name;
}
}