aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/resource.cpp10
-rw-r--r--engines/director/score.cpp17
-rw-r--r--engines/director/score.h3
3 files changed, 23 insertions, 7 deletions
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 61e46e9a8d..bcf5db61bc 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -210,7 +210,15 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
Score *castScore = new Score(this, shardcst);
castScore->loadConfig(*shardcst->getResource(MKTAG('V','W','C','F'), 1024));
- castScore->loadCastData(*shardcst->getResource(MKTAG('V','W','C','R'), 1024));
+
+ if (getVersion() < 4)
+ castScore->loadCastDataD2(*shardcst->getResource(MKTAG('V','W','C','R'), 1024));
+
+ Common::Array<uint16> cast = shardcst->getResourceIDList(MKTAG('C','A','S','t'));
+ if (cast.size() > 0) {
+ for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator)
+ castScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator);
+ }
_sharedCasts = &castScore->_casts;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2bb538a91d..4519bfd71a 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -192,7 +192,7 @@ void Score::loadArchive() {
if (_vm->getVersion() < 4) {
assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024));
- loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024));
+ loadCastDataD2(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024));
}
if (_movieArchive->hasResource(MKTAG('V','W','A','C'), 1024)) {
@@ -209,12 +209,16 @@ void Score::loadArchive() {
Common::Array<uint16> vwci = _movieArchive->getResourceIDList(MKTAG('V','W','C','I'));
if (vwci.size() > 0) {
- Common::Array<uint16>::iterator iterator;
-
- for (iterator = vwci.begin(); iterator != vwci.end(); ++iterator)
+ for (Common::Array<uint16>::iterator iterator = vwci.begin(); iterator != vwci.end(); ++iterator)
loadCastInfo(*_movieArchive->getResource(MKTAG('V','W','C','I'), *iterator), *iterator);
}
+ Common::Array<uint16> cast = _movieArchive->getResourceIDList(MKTAG('C','A','S','t'));
+ if (cast.size() > 0) {
+ for (Common::Array<uint16>::iterator iterator = cast.begin(); iterator != cast.end(); ++iterator)
+ loadCastData(*_movieArchive->getResource(MKTAG('C','A','S','t'), *iterator), *iterator);
+ }
+
Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
if (stxt.size() > 0) {
loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *stxt.begin()));
@@ -343,7 +347,7 @@ void Score::readVersion(uint32 rid) {
debug("Version: %d.%d", _versionMajor, _versionMinor);
}
-void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream) {
+void Score::loadCastDataD2(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "Score::loadCastData(). start: %d, end: %d", _castArrayStart, _castArrayEnd);
for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
@@ -388,6 +392,9 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream) {
}
}
+void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id) {
+}
+
void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) {
_labels = new Common::SortedArray<Label *>(compareLabels);
uint16 count = stream.readUint16() + 1;
diff --git a/engines/director/score.h b/engines/director/score.h
index 83f25284b1..62c41cbd67 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -186,7 +186,8 @@ public:
void processEvents();
Archive *getArchive() const { return _movieArchive; };
void loadConfig(Common::SeekableSubReadStreamEndian &stream);
- void loadCastData(Common::SeekableSubReadStreamEndian &stream);
+ void loadCastDataD2(Common::SeekableSubReadStreamEndian &stream);
+ void loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id);
void setCurrentFrame(uint16 frameId) { _currentFrame = frameId; }
int getCurrentFrame() { return _currentFrame; }
Common::String getMacName() const { return _macName; }