From cdf30ecc5acf689a44156b7afdab7571d519d220 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 10 May 2010 00:50:37 +0000 Subject: Minor fix for using the MacResManager with a regular file; switch MacBinary's data fork to using a SeekableSubReadStream instead of a MemoryReadStream. svn-id: r48995 --- common/macresman.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/macresman.cpp b/common/macresman.cpp index d58bfcd81f..24099475a7 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -108,6 +108,7 @@ bool MacResManager::open(Common::String filename) { // Fine, what about just the data fork? if (file->open(filename)) { _baseFileName = filename; + _stream = file; return true; } @@ -218,8 +219,7 @@ Common::SeekableReadStream *MacResManager::getDataFork() { if (_mode == kResForkMacBinary) { _stream->seek(MBI_DFLEN); uint32 dataSize = _stream->readUint32BE(); - _stream->seek(MBI_INFOHDR); - return _stream->readStream(dataSize); + return new SeekableSubReadStream(_stream, MBI_INFOHDR, MBI_INFOHDR + dataSize); } Common::File *file = new Common::File(); -- cgit v1.2.3