diff options
author | Dmitry Iskrich | 2016-06-03 19:07:30 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | bd345ce81c0edd1267909b0bcac7bcf65dea834b (patch) | |
tree | 47106ae17ef59968b05db41f508f559bf518efa0 /engines/director | |
parent | f95410532015363eb158537637147cb97081eee9 (diff) | |
download | scummvm-rg350-bd345ce81c0edd1267909b0bcac7bcf65dea834b.tar.gz scummvm-rg350-bd345ce81c0edd1267909b0bcac7bcf65dea834b.tar.bz2 scummvm-rg350-bd345ce81c0edd1267909b0bcac7bcf65dea834b.zip |
DIRECTOR: Parse mac name
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/resource.cpp | 21 | ||||
-rw-r--r-- | engines/director/score.cpp | 4 |
2 files changed, 21 insertions, 4 deletions
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 8eb4b92b14..2c90dfd203 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -244,6 +244,18 @@ bool RIFFArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff if (tag == 0) break; + uint16 startResPos = stream->pos(); + stream->seek(offset + 12); + + Common::String name = ""; + byte nameSize = stream->readByte(); + if (nameSize) { + for (uint8 i = 0; i < nameSize; i++) { + name += stream->readByte(); + } + } + + stream->seek(startResPos); debug(0, "Found RIFF resource '%s' %d: %d @ 0x%08x", tag2str(tag), id, size, offset); @@ -251,6 +263,7 @@ bool RIFFArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff Resource &res = resMap[id]; res.offset = offset; res.size = size; + res.name = name; } _stream = stream; @@ -273,9 +286,10 @@ Common::SeekableReadStream *RIFFArchive::getResource(uint32 tag, uint16 id) { uint32 size = res.size - 4; // Skip the Pascal string _stream->seek(offset); - byte stringSize = _stream->readByte() + 1; // 1 for this byte - offset += stringSize; - size -= stringSize; + byte stringSize = _stream->readByte(); // 1 for this byte + + offset += stringSize + 1; + size -= stringSize + 1; // Align to nearest word boundary if (offset & 1) { @@ -286,7 +300,6 @@ Common::SeekableReadStream *RIFFArchive::getResource(uint32 tag, uint16 id) { return new Common::SeekableSubReadStream(_stream, offset, offset + size); } - // RIFX Archive code bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOffset) { diff --git a/engines/director/score.cpp b/engines/director/score.cpp index bd07f7849d..889020cdff 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -54,6 +54,10 @@ Score::Score(Archive &movie) { if (_movieArchive->hasResource(MKTAG('V','W','A','C'), 1024)) { loadActions(*_movieArchive->getResource(MKTAG('V','W','A','C'), 1024)); } + + if (_movieArchive->hasResource(MKTAG('M','C','N','M'), 0)) { + debug("Mac name %s", _movieArchive->getName(MKTAG('M','C','N','M'), 0).c_str()); + } } void Score::loadFrames(Common::SeekableReadStream &stream) { |