aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-30 18:21:34 +0200
committerEugene Sandulenko2016-08-30 18:21:34 +0200
commitfe22b8bd0e70839a001e0c91e9e598faa36e724b (patch)
treea698af6fe3db548d9f8cc905b24a7d20c16f5490
parent6d3e772897a9fad59899e41e289720c1945a958a (diff)
downloadscummvm-rg350-fe22b8bd0e70839a001e0c91e9e598faa36e724b.tar.gz
scummvm-rg350-fe22b8bd0e70839a001e0c91e9e598faa36e724b.tar.bz2
scummvm-rg350-fe22b8bd0e70839a001e0c91e9e598faa36e724b.zip
DIRECTOR: Fix scanned archive names
-rw-r--r--engines/director/director.cpp2
-rw-r--r--engines/director/frame.cpp2
-rw-r--r--engines/director/resource.cpp8
-rw-r--r--engines/director/resource.h4
-rw-r--r--engines/director/score.cpp12
5 files changed, 22 insertions, 6 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index e72ad89f89..e1f4ef1bdb 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -152,6 +152,8 @@ Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::St
arc->openFile(i->getName());
Score *sc = new Score(this, arc);
nameMap[sc->getMacName()] = sc;
+
+ debugC(2, kDebugLoading, "Movie name: \"%s\"", sc->getMacName().c_str());
}
}
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 3d5d8b6a4b..174581f336 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -174,7 +174,7 @@ void Frame::readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16
default:
offset++;
stream.readByte();
- debug("Field Position %d, Finish Position %d", offset, finishPosition);
+ debugC(kDebugLoading, "Frame::readMainChannels: Field Position %d, Finish Position %d", offset, finishPosition);
break;
}
}
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 787becf28c..7bb73289dd 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -51,6 +51,8 @@ bool Archive::openFile(const Common::String &fileName) {
return false;
}
+ _fileName = fileName;
+
return true;
}
@@ -190,6 +192,12 @@ bool MacArchive::openFile(const Common::String &fileName) {
return false;
}
+ _fileName = _resFork->getBaseFileName();
+ if (_fileName.hasSuffix(".bin")) {
+ for (int i = 0; i < 4; i++)
+ _fileName.deleteLastChar();
+ }
+
Common::MacResTagArray tagArray = _resFork->getResTagArray();
for (uint32 i = 0; i < tagArray.size(); i++) {
diff --git a/engines/director/resource.h b/engines/director/resource.h
index 2d5a4aeba1..8e2ceaeaa5 100644
--- a/engines/director/resource.h
+++ b/engines/director/resource.h
@@ -43,6 +43,8 @@ public:
virtual bool openStream(Common::SeekableReadStream *stream, uint32 offset = 0) = 0;
virtual void close();
+ Common::String getFileName() const { return _fileName; }
+
bool isOpen() const { return _stream != 0; }
bool hasResource(uint32 tag, uint16 id) const;
@@ -67,6 +69,8 @@ protected:
typedef Common::HashMap<uint16, Resource> ResourceMap;
typedef Common::HashMap<uint32, ResourceMap> TypeMap;
TypeMap _types;
+
+ Common::String _fileName;
};
class MacArchive : public Archive {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 6d6d02274c..90506519ac 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -108,12 +108,14 @@ Score::Score(DirectorEngine *vm, Archive *archive) {
_stopPlay = false;
_stageColor = 0;
- if (_movieArchive->hasResource(MKTAG('M','C','N','M'), 0)) {
- _macName = _movieArchive->getName(MKTAG('M','C','N','M'), 0).c_str();
+ if (archive->hasResource(MKTAG('M','C','N','M'), 0)) {
+ _macName = archive->getName(MKTAG('M','C','N','M'), 0).c_str();
+ } else {
+ _macName = archive->getFileName();
}
- if (_movieArchive->hasResource(MKTAG('V','W','L','B'), 1024)) {
- loadLabels(*_movieArchive->getResource(MKTAG('V','W','L','B'), 1024));
+ if (archive->hasResource(MKTAG('V','W','L','B'), 1024)) {
+ loadLabels(*archive->getResource(MKTAG('V','W','L','B'), 1024));
}
}
@@ -344,7 +346,7 @@ void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) {
Common::SortedArray<Label *>::iterator j;
for (j = _labels->begin(); j != _labels->end(); ++j) {
- debug("Frame %d, Label %s", (*j)->number, (*j)->name.c_str());
+ debugC(2, kDebugLoading, "Frame %d, Label %s", (*j)->number, (*j)->name.c_str());
}
}