diff options
author | Dmitry Iskrich | 2016-06-06 19:11:20 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 414a0b1c3505cba60696d294371ddb6022cb4af1 (patch) | |
tree | 72ce846a16de1e80679ee6e0bb5a47a5feadfb12 /engines | |
parent | 1b6b24740e91cb6a3191728e0e2f01c4d475cc84 (diff) | |
download | scummvm-rg350-414a0b1c3505cba60696d294371ddb6022cb4af1.tar.gz scummvm-rg350-414a0b1c3505cba60696d294371ddb6022cb4af1.tar.bz2 scummvm-rg350-414a0b1c3505cba60696d294371ddb6022cb4af1.zip |
DIRECTOR: Add file info loading, fix strings loading
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/score.cpp | 13 | ||||
-rw-r--r-- | engines/director/score.h | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 59e3f9e507..315d431fe4 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -59,6 +59,9 @@ Score::Score(Archive &movie) { debug("Mac name %s", _movieArchive->getName(MKTAG('M','C','N','M'), 0).c_str()); } + if (_movieArchive->hasResource(MKTAG('V','W','F','I'), 1024)) { + loadFileInfo(*_movieArchive->getResource(MKTAG('V','W','F','I'), 1024)); + } Common::Array<uint16> vwci = _movieArchive->getResourceIDList(MKTAG('V','W','C','I')); if (vwci.size() > 0) { @@ -239,6 +242,14 @@ void Score::loadCastInfo(Common::SeekableReadStream &stream) { //TODO storage in array, and use this info } +void Score::loadFileInfo(Common::SeekableReadStream &stream) { + Common::Array<Common::String> fileInfoStrings = loadStrings(stream, _flags); + _script = fileInfoStrings[0]; + _changedBy = fileInfoStrings[1]; + _createdBy = fileInfoStrings[2]; + _directory = fileInfoStrings[3]; +} + Common::Array<Common::String> Score::loadStrings(Common::SeekableReadStream &stream, uint32 &entryType, bool hasHeader) { Common::Array<Common::String> strings; uint32 offset = 0; @@ -251,7 +262,7 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableReadStream &str } uint16 count = stream.readUint16BE(); - offset += count * 2 + 16; //positions info + header info + offset += (count + 1) * 4 + 2; //positions info + uint16 count uint32 startPos = stream.readUint32BE() + offset; for (uint16 i = 0; i < count; i++) { Common::String entryString; diff --git a/engines/director/score.h b/engines/director/score.h index b8312df5dc..e93b6ba951 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -206,6 +206,7 @@ private: void loadLabels(Common::SeekableReadStream &stream); void loadActions(Common::SeekableReadStream &stream); void loadCastInfo(Common::SeekableReadStream &stream); + void loadFileInfo(Common::SeekableReadStream &stream); Common::Array<Common::String> loadStrings(Common::SeekableReadStream &stream, uint32 &entryType, bool hasHeader = true); public: Common::Array<Frame *> _frames; @@ -216,6 +217,10 @@ public: private: uint16 _versionMinor; uint16 _versionMajor; + Common::String _createdBy; + Common::String _changedBy; + Common::String _script; + Common::String _directory; byte _currentFrameRate; uint16 _castArrayStart; uint16 _currentFrame; |