diff options
author | Dmitry Iskrich | 2016-06-27 14:49:04 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 8a884ad08cd7e638f3be19cfb49a4642f88eb7bd (patch) | |
tree | 267c6be80565b8a69518c7caa00a6de91100b8dd /engines/director | |
parent | b2a152dd54e86247a06fa91c5c0ff6f092acc943 (diff) | |
download | scummvm-rg350-8a884ad08cd7e638f3be19cfb49a4642f88eb7bd.tar.gz scummvm-rg350-8a884ad08cd7e638f3be19cfb49a4642f88eb7bd.tar.bz2 scummvm-rg350-8a884ad08cd7e638f3be19cfb49a4642f88eb7bd.zip |
DIRECTOR: Change ReadStream to ReadStreamEndian
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/lingo/lingo-funcs.cpp | 3 | ||||
-rw-r--r-- | engines/director/resource.cpp | 14 | ||||
-rw-r--r-- | engines/director/resource.h | 16 | ||||
-rw-r--r-- | engines/director/score.cpp | 141 | ||||
-rw-r--r-- | engines/director/score.h | 43 |
5 files changed, 109 insertions, 108 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp index 74897bd345..39e50f5565 100644 --- a/engines/director/lingo/lingo-funcs.cpp +++ b/engines/director/lingo/lingo-funcs.cpp @@ -190,14 +190,13 @@ void Lingo::func_mciwait(Common::String &s) { } void Lingo::func_goto(Common::String &frame, Common::String &movie) { - warning("STUB: go to %s movie %s", frame.c_str(), movie.c_str()); if (!_vm->_movies->contains(movie)) error("Movie %s does not exist", movie.c_str()); _vm->_currentScore = _vm->_movies->getVal(movie); _vm->_currentScore->loadArchive(); - if (frame.c_str() != "") + if (!frame.empty()) _vm->_currentScore->setStartToLabel(frame); } diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 3ac9b4b6ca..5a2033a5a5 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -34,6 +34,7 @@ namespace Director { Archive::Archive() { _stream = 0; + _isBigEndian = true; } Archive::~Archive() { @@ -81,7 +82,7 @@ bool Archive::hasResource(uint32 tag, const Common::String &resName) const { return false; } -Common::SeekableReadStream *Archive::getResource(uint32 tag, uint16 id) { +Common::SeekableSubReadStreamEndian *Archive::getResource(uint32 tag, uint16 id) { if (!_types.contains(tag)) error("Archive does not contain '%s' %04x", tag2str(tag), id); @@ -92,7 +93,7 @@ Common::SeekableReadStream *Archive::getResource(uint32 tag, uint16 id) { const Resource &res = resMap[id]; - return new Common::SeekableSubReadStream(_stream, res.offset, res.offset + res.size); + return new Common::SeekableSubReadStreamEndian(_stream, res.offset, res.offset + res.size, _isBigEndian, DisposeAfterUse::NO); } uint32 Archive::getOffset(uint32 tag, uint16 id) const { @@ -211,9 +212,10 @@ bool MacArchive::openStream(Common::SeekableReadStream *stream, uint32 startOffs return false; } -Common::SeekableReadStream *MacArchive::getResource(uint32 tag, uint16 id) { +Common::SeekableSubReadStreamEndian *MacArchive::getResource(uint32 tag, uint16 id) { assert(_resFork); - return _resFork->getResource(tag, id); + Common::SeekableReadStream *stream = _resFork->getResource(tag, id); + return new Common::SeekableSubReadStreamEndian(stream, 0, stream->size(), DisposeAfterUse::NO); } // RIFF Archive code @@ -275,7 +277,7 @@ bool RIFFArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff return true; } -Common::SeekableReadStream *RIFFArchive::getResource(uint32 tag, uint16 id) { +Common::SeekableSubReadStreamEndian *RIFFArchive::getResource(uint32 tag, uint16 id) { if (!_types.contains(tag)) error("Archive does not contain '%s' %04x", tag2str(tag), id); @@ -302,7 +304,7 @@ Common::SeekableReadStream *RIFFArchive::getResource(uint32 tag, uint16 id) { size--; } - return new Common::SeekableSubReadStream(_stream, offset, offset + size); + return new Common::SeekableSubReadStreamEndian(_stream, offset, offset + size, true, DisposeAfterUse::NO); } // RIFX Archive code diff --git a/engines/director/resource.h b/engines/director/resource.h index 93b1bd9d1d..fda8b79d82 100644 --- a/engines/director/resource.h +++ b/engines/director/resource.h @@ -29,6 +29,7 @@ #include "common/hashmap.h" #include "common/file.h" #include "common/str.h" +#include "common/substream.h" namespace Common { class MacResManager; @@ -51,25 +52,23 @@ public: bool hasResource(uint32 tag, uint16 id) const; bool hasResource(uint32 tag, const Common::String &resName) const; - virtual Common::SeekableReadStream *getResource(uint32 tag, uint16 id); + virtual Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id); uint32 getOffset(uint32 tag, uint16 id) const; uint16 findResourceID(uint32 tag, const Common::String &resName) const; Common::String getName(uint32 tag, uint16 id) const; Common::Array<uint32> getResourceTypeList() const; Common::Array<uint16> getResourceIDList(uint32 type) const; - + bool _isBigEndian; static uint32 convertTagToUppercase(uint32 tag); protected: Common::SeekableReadStream *_stream; - struct Resource { uint32 offset; uint32 size; Common::String name; }; - typedef Common::HashMap<uint16, Resource> ResourceMap; typedef Common::HashMap<uint32, ResourceMap> TypeMap; TypeMap _types; @@ -83,7 +82,7 @@ public: void close(); bool openFile(const Common::String &fileName); bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0); - Common::SeekableReadStream *getResource(uint32 tag, uint16 id); + Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id); private: Common::MacResManager *_resFork; @@ -95,18 +94,15 @@ public: ~RIFFArchive() {} bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0); - Common::SeekableReadStream *getResource(uint32 tag, uint16 id); + Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id); }; class RIFXArchive : public Archive { public: - RIFXArchive() : Archive(), _isBigEndian(true) {} + RIFXArchive() : Archive(){ _isBigEndian = true; } ~RIFXArchive() {} bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0); - -private: - bool _isBigEndian; }; } // End of namespace Director diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 6d5247ff98..a84228741b 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -67,7 +67,8 @@ void Score::loadArchive() { if (clutList.size() == 0) error("CLUT not found"); - Common::SeekableReadStream *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]); + + Common::SeekableSubReadStreamEndian *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]); loadPalette(*pal); g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount()); @@ -122,7 +123,7 @@ Score::~Score() { delete _movieArchive; } -void Score::loadPalette(Common::SeekableReadStream &stream) { +void Score::loadPalette(Common::SeekableSubReadStreamEndian &stream) { uint16 steps = stream.size() / 6; uint16 index = (steps * 3) - 1; uint16 _paletteColorCount = steps; @@ -142,8 +143,8 @@ void Score::loadPalette(Common::SeekableReadStream &stream) { _vm->setPalette(_palette, _paletteColorCount); } -void Score::loadFrames(Common::SeekableReadStream &stream) { - uint32 size = stream.readUint32BE(); +void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) { + uint32 size = stream.readUint32(); size -= 4; uint16 channelSize; uint16 channelOffset; @@ -152,7 +153,7 @@ void Score::loadFrames(Common::SeekableReadStream &stream) { _frames.push_back(initial); while (size != 0) { - uint16 frameSize = stream.readUint16BE(); + uint16 frameSize = stream.readUint16(); size -= frameSize; frameSize -= 2; Frame *frame = new Frame(*_frames.back()); @@ -171,16 +172,16 @@ void Score::loadFrames(Common::SeekableReadStream &stream) { _frames.remove_at(0); } -void Score::loadConfig(Common::SeekableReadStream &stream) { - /*uint16 unk1 = */ stream.readUint16BE(); - /*ver1 = */ stream.readUint16BE(); +void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) { + /*uint16 unk1 = */ stream.readUint16(); + /*ver1 = */ stream.readUint16(); _movieRect = Score::readRect(stream); - _castArrayStart = stream.readUint16BE(); - _castArrayEnd = stream.readUint16BE(); + _castArrayStart = stream.readUint16(); + _castArrayEnd = stream.readUint16(); _currentFrameRate = stream.readByte(); stream.skip(9); - _stageColor = stream.readUint16BE(); + _stageColor = stream.readUint16(); } void Score::readVersion(uint32 rid) { @@ -190,7 +191,7 @@ void Score::readVersion(uint32 rid) { debug("Version: %d.%d", _versionMajor, _versionMinor); } -void Score::loadCastData(Common::SeekableReadStream &stream) { +void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream) { for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) { byte size = stream.readByte(); @@ -234,16 +235,16 @@ void Score::loadCastData(Common::SeekableReadStream &stream) { } } -void Score::loadLabels(Common::SeekableReadStream &stream) { - uint16 count = stream.readUint16BE() + 1; +void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) { + uint16 count = stream.readUint16() + 1; uint16 offset = count * 4 + 2; - uint16 frame = stream.readUint16BE(); - uint16 stringPos = stream.readUint16BE() + offset; + uint16 frame = stream.readUint16(); + uint16 stringPos = stream.readUint16() + offset; for (uint16 i = 0; i < count; i++) { - uint16 nextFrame = stream.readUint16BE(); - uint16 nextStringPos = stream.readUint16BE() + offset; + uint16 nextFrame = stream.readUint16(); + uint16 nextStringPos = stream.readUint16() + offset; uint16 streamPos = stream.pos(); stream.seek(stringPos); @@ -265,18 +266,18 @@ void Score::loadLabels(Common::SeekableReadStream &stream) { } } -void Score::loadActions(Common::SeekableReadStream &stream) { - uint16 count = stream.readUint16BE() + 1; +void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) { + uint16 count = stream.readUint16() + 1; uint16 offset = count * 4 + 2; byte id = stream.readByte(); /*byte subId = */ stream.readByte(); //I couldn't find how it used in continuity (except print). Frame actionId = 1 byte. - uint16 stringPos = stream.readUint16BE() + offset; + uint16 stringPos = stream.readUint16() + offset; for (uint16 i = 0; i < count; i++) { uint16 nextId = stream.readByte(); /*byte subId = */ stream.readByte(); - uint16 nextStringPos = stream.readUint16BE() + offset; + uint16 nextStringPos = stream.readUint16() + offset; uint16 streamPos = stream.pos(); stream.seek(stringPos); @@ -313,10 +314,10 @@ void Score::loadActions(Common::SeekableReadStream &stream) { } } -void Score::loadScriptText(Common::SeekableReadStream &stream) { - /*uint32 unk1 = */ stream.readUint32BE(); - uint32 strLen = stream.readUint32BE(); - /*uin32 dataLen = */ stream.readUint32BE(); +void Score::loadScriptText(Common::SeekableSubReadStreamEndian &stream) { + /*uint32 unk1 = */ stream.readUint32(); + uint32 strLen = stream.readUint32(); + /*uin32 dataLen = */ stream.readUint32(); Common::String script; for (uint32 i = 0; i < strLen; i++) { @@ -382,7 +383,7 @@ void Score::dumpScript(uint16 id, ScriptType type, Common::String script) { out.close(); } -void Score::loadCastInfo(Common::SeekableReadStream &stream, uint16 id) { +void Score::loadCastInfo(Common::SeekableSubReadStreamEndian &stream, uint16 id) { uint32 entryType = 0; Common::Array<Common::String> castStrings = loadStrings(stream, entryType); CastInfo *ci = new CastInfo(); @@ -425,7 +426,7 @@ Common::String Score::getString(Common::String str) { return str; } -void Score::loadFileInfo(Common::SeekableReadStream &stream) { +void Score::loadFileInfo(Common::SeekableSubReadStreamEndian &stream) { Common::Array<Common::String> fileInfoStrings = loadStrings(stream, _flags); _script = fileInfoStrings[0]; @@ -443,25 +444,25 @@ void Score::loadFileInfo(Common::SeekableReadStream &stream) { _directory = fileInfoStrings[3]; } -Common::Array<Common::String> Score::loadStrings(Common::SeekableReadStream &stream, uint32 &entryType, bool hasHeader) { +Common::Array<Common::String> Score::loadStrings(Common::SeekableSubReadStreamEndian &stream, uint32 &entryType, bool hasHeader) { Common::Array<Common::String> strings; uint32 offset = 0; if (hasHeader) { - offset = stream.readUint32BE(); - /*uint32 unk1 = */ stream.readUint32BE(); - /*uint32 unk2 = */ stream.readUint32BE(); - entryType = stream.readUint32BE(); + offset = stream.readUint32(); + /*uint32 unk1 = */ stream.readUint32(); + /*uint32 unk2 = */ stream.readUint32(); + entryType = stream.readUint32(); stream.seek(offset); } - uint16 count = stream.readUint16BE(); + uint16 count = stream.readUint16(); offset += (count + 1) * 4 + 2; //positions info + uint16 count - uint32 startPos = stream.readUint32BE() + offset; + uint32 startPos = stream.readUint32() + offset; for (uint16 i = 0; i < count; i++) { Common::String entryString; - uint32 nextPos = stream.readUint32BE() + offset; + uint32 nextPos = stream.readUint32() + offset; uint32 streamPos = stream.pos(); stream.seek(startPos); @@ -480,13 +481,13 @@ Common::Array<Common::String> Score::loadStrings(Common::SeekableReadStream &str return strings; } -void Score::loadFontMap(Common::SeekableReadStream &stream) { - uint16 count = stream.readUint16BE(); +void Score::loadFontMap(Common::SeekableSubReadStreamEndian &stream) { + uint16 count = stream.readUint16(); uint32 offset = (count * 2) + 2; uint16 currentRawPosition = offset; for (uint16 i = 0; i < count; i++) { - uint16 id = stream.readUint16BE(); + uint16 id = stream.readUint16(); uint32 positionInfo = stream.pos(); stream.seek(currentRawPosition); @@ -504,29 +505,29 @@ void Score::loadFontMap(Common::SeekableReadStream &stream) { } } -BitmapCast::BitmapCast(Common::SeekableReadStream &stream) { +BitmapCast::BitmapCast(Common::SeekableSubReadStreamEndian &stream) { /*byte flags = */ stream.readByte(); - uint16 someFlaggyThing = stream.readUint16BE(); + uint16 someFlaggyThing = stream.readUint16(); initialRect = Score::readRect(stream); boundingRect = Score::readRect(stream); - regY = stream.readUint16BE(); - regX = stream.readUint16BE(); + regY = stream.readUint16(); + regX = stream.readUint16(); if (someFlaggyThing & 0x8000) { - /*uint16 unk1 =*/ stream.readUint16BE(); - /*uint16 unk2 =*/ stream.readUint16BE(); + /*uint16 unk1 =*/ stream.readUint16(); + /*uint16 unk2 =*/ stream.readUint16(); } } -TextCast::TextCast(Common::SeekableReadStream &stream) { +TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) { /*byte flags =*/ stream.readByte(); borderSize = static_cast<SizeType>(stream.readByte()); gutterSize = static_cast<SizeType>(stream.readByte()); boxShadow = static_cast<SizeType>(stream.readByte()); textType = static_cast<TextType>(stream.readByte()); - textAlign = static_cast<TextAlignType>(stream.readUint16BE()); + textAlign = static_cast<TextAlignType>(stream.readUint16()); stream.skip(6); //palinfo - /*uint32 unk1 = */ stream.readUint32BE(); + /*uint32 unk1 = */ stream.readUint32(); initialRect = Score::readRect(stream); textShadow = static_cast<SizeType>(stream.readByte()); byte flags = stream.readByte(); @@ -537,10 +538,10 @@ TextCast::TextCast(Common::SeekableReadStream &stream) { if (flags & 0x4) textFlags.push_back(kTextFlagDoNotWrap); - /*uint16 unk2 =*/ stream.readUint16BE(); + /*uint16 unk2 =*/ stream.readUint16(); } -ShapeCast::ShapeCast(Common::SeekableReadStream &stream) { +ShapeCast::ShapeCast(Common::SeekableSubReadStreamEndian &stream) { /*byte flags = */ stream.readByte(); /*unk1 = */ stream.readByte(); shapeType = static_cast<ShapeType>(stream.readByte()); @@ -553,12 +554,12 @@ ShapeCast::ShapeCast(Common::SeekableReadStream &stream) { lineDirection = stream.readByte(); } -Common::Rect Score::readRect(Common::SeekableReadStream &stream) { +Common::Rect Score::readRect(Common::SeekableSubReadStreamEndian &stream) { Common::Rect *rect = new Common::Rect(); - rect->top = stream.readUint16BE(); - rect->left = stream.readUint16BE(); - rect->bottom = stream.readUint16BE(); - rect->right = stream.readUint16BE(); + rect->top = stream.readUint16(); + rect->left = stream.readUint16(); + rect->bottom = stream.readUint16(); + rect->right = stream.readUint16(); return *rect; } @@ -727,7 +728,7 @@ Frame::~Frame() { } } -void Frame::readChannel(Common::SeekableReadStream &stream, uint16 offset, uint16 size) { +void Frame::readChannel(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size) { if (offset >= 32) { if (size <= 16) readSprite(stream, offset, size); @@ -748,7 +749,7 @@ void Frame::readChannel(Common::SeekableReadStream &stream, uint16 offset, uint1 } } -void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, uint16 size) { +void Frame::readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size) { uint16 finishPosition = offset + size; while (offset < finishPosition) { @@ -784,7 +785,7 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, offset++; break; case kSound1Position: - _sound1 = stream.readUint16LE(); + _sound1 = stream.readUint16(); offset+=2; break; case kSkipFrameFlagsPosition: @@ -796,7 +797,7 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, offset++; break; case kSound2Position: - _sound2 = stream.readUint16LE(); + _sound2 = stream.readUint16(); offset += 2; break; case kSound2TypePosition: @@ -804,7 +805,7 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, offset += 1; break; case kPaletePosition: - if (stream.readUint16LE()) + if (stream.readUint16()) readPaletteInfo(stream); offset += 16; default: @@ -816,16 +817,16 @@ void Frame::readMainChannels(Common::SeekableReadStream &stream, uint16 offset, } } -void Frame::readPaletteInfo(Common::SeekableReadStream &stream) { +void Frame::readPaletteInfo(Common::SeekableSubReadStreamEndian &stream) { _palette->firstColor = stream.readByte(); _palette->lastColor = stream.readByte(); _palette->flags = stream.readByte(); _palette->speed = stream.readByte(); - _palette->frameCount = stream.readUint16LE(); + _palette->frameCount = stream.readUint16(); stream.skip(8); //unknown } -void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 size) { +void Frame::readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size) { uint16 spritePosition = (offset - 32) / 16; uint16 spriteStart = spritePosition * 16 + 32; @@ -845,11 +846,11 @@ void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 fieldPosition++; break; case kSpritePositionUnk2: - /*byte x2 = */ stream.readUint16BE(); + /*byte x2 = */ stream.readUint16(); fieldPosition += 2; break; case kSpritePositionFlags: - sprite._flags = stream.readUint16BE(); + sprite._flags = stream.readUint16(); sprite._ink = static_cast<InkType>(sprite._flags & 0x3f); if (sprite._flags & 0x40) @@ -860,23 +861,23 @@ void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 fieldPosition += 2; break; case kSpritePositionCastId: - sprite._castId = stream.readUint16BE(); + sprite._castId = stream.readUint16(); fieldPosition += 2; break; case kSpritePositionY: - sprite._startPoint.y = stream.readUint16BE(); + sprite._startPoint.y = stream.readUint16(); fieldPosition += 2; break; case kSpritePositionX: - sprite._startPoint.x = stream.readUint16BE(); + sprite._startPoint.x = stream.readUint16(); fieldPosition += 2; break; case kSpritePositionWidth: - sprite._width = stream.readUint16BE(); + sprite._width = stream.readUint16(); fieldPosition += 2; break; case kSpritePositionHeight: - sprite._height = stream.readUint16BE(); + sprite._height = stream.readUint16(); fieldPosition += 2; break; default: diff --git a/engines/director/score.h b/engines/director/score.h index f276ff5cc1..af8cd1746b 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -171,7 +171,7 @@ struct Cast { }; struct BitmapCast : Cast { - BitmapCast(Common::SeekableReadStream &stream); + BitmapCast(Common::SeekableSubReadStreamEndian &stream); Common::Rect boundingRect; uint16 regX; @@ -187,7 +187,7 @@ enum ShapeType { }; struct ShapeCast : Cast { - ShapeCast(Common::SeekableReadStream &stream); + ShapeCast(Common::SeekableSubReadStreamEndian &stream); ShapeType shapeType; uint16 pattern; @@ -226,7 +226,7 @@ enum SizeType { }; struct TextCast : Cast { - TextCast(Common::SeekableReadStream &stream); + TextCast(Common::SeekableSubReadStreamEndian &stream); SizeType borderSize; SizeType gutterSize; @@ -245,7 +245,7 @@ enum ButtonType { }; struct ButtonCast : TextCast { - ButtonCast(Common::SeekableReadStream &stream) : TextCast(stream) { + ButtonCast(Common::SeekableSubReadStreamEndian &stream) : TextCast(stream) { buttonType = static_cast<ButtonType>(stream.readUint16BE()); } @@ -290,7 +290,7 @@ public: Frame(const Frame &frame); ~Frame(); - void readChannel(Common::SeekableReadStream &stream, uint16 offset, uint16 size); + void readChannel(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size); void prepareFrame(Score *score); uint16 getSpriteIDFromPos(Common::Point pos); @@ -299,9 +299,9 @@ private: void playSoundChannel(); void renderSprites(Graphics::ManagedSurface &surface, bool renderTrail); void renderText(Graphics::ManagedSurface &surface, uint16 spriteID); - void readPaletteInfo(Common::SeekableReadStream &stream); - void readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 size); - void readMainChannels(Common::SeekableReadStream &stream, uint16 offset, uint16 size); + void readPaletteInfo(Common::SeekableSubReadStreamEndian &stream); + void readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size); + void readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size); void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect); void drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect); void drawGhostSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect); @@ -332,9 +332,12 @@ public: Score(DirectorEngine *vm); ~Score(); - static Common::Rect readRect(Common::SeekableReadStream &stream); + static Common::Rect readRect(Common::SeekableSubReadStreamEndian &stream); void loadArchive(); void setStartToLabel(Common::String label); + void goToLoop(); + void goToNext(); + void goToPrevious(); void startLoop(); void processEvents(); Archive *getArchive() const { return _movieArchive; }; @@ -343,19 +346,19 @@ public: private: void update(); void readVersion(uint32 rid); - void loadConfig(Common::SeekableReadStream &stream); - void loadPalette(Common::SeekableReadStream &stream); - void loadCastData(Common::SeekableReadStream &stream); - void loadFrames(Common::SeekableReadStream &stream); - void loadLabels(Common::SeekableReadStream &stream); - void loadActions(Common::SeekableReadStream &stream); - void loadCastInfo(Common::SeekableReadStream &stream, uint16 id); - void loadScriptText(Common::SeekableReadStream &stream); - void loadFileInfo(Common::SeekableReadStream &stream); - void loadFontMap(Common::SeekableReadStream &stream); + void loadConfig(Common::SeekableSubReadStreamEndian &stream); + void loadPalette(Common::SeekableSubReadStreamEndian &stream); + void loadCastData(Common::SeekableSubReadStreamEndian &stream); + void loadFrames(Common::SeekableSubReadStreamEndian &stream); + void loadLabels(Common::SeekableSubReadStreamEndian &stream); + void loadActions(Common::SeekableSubReadStreamEndian &stream); + void loadCastInfo(Common::SeekableSubReadStreamEndian &stream, uint16 id); + void loadScriptText(Common::SeekableSubReadStreamEndian &stream); + void loadFileInfo(Common::SeekableSubReadStreamEndian &stream); + void loadFontMap(Common::SeekableSubReadStreamEndian &stream); void dumpScript(uint16 id, ScriptType type, Common::String script); Common::String getString(Common::String str); - Common::Array<Common::String> loadStrings(Common::SeekableReadStream &stream, uint32 &entryType, bool hasHeader = true); + Common::Array<Common::String> loadStrings(Common::SeekableSubReadStreamEndian &stream, uint32 &entryType, bool hasHeader = true); public: Common::Array<Frame *> _frames; |