From 4168b50fc3951cb716597ed8bf559d883828ff1a Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 13 Aug 2012 02:19:41 +0200 Subject: WINTERMUTE: Remove BPkgFile, as wrapCompressedStream can handle that job now. --- engines/wintermute/base/file/base_file_entry.cpp | 32 +----------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/engines/wintermute/base/file/base_file_entry.cpp b/engines/wintermute/base/file/base_file_entry.cpp index da1bfa7ac8..a08d55db43 100644 --- a/engines/wintermute/base/file/base_file_entry.cpp +++ b/engines/wintermute/base/file/base_file_entry.cpp @@ -33,31 +33,6 @@ #include "common/zlib.h" namespace WinterMute { -// HACK: wrapCompressedStream might set the size to 0, so we need a way to override it. -class CBPkgFile : public Common::SeekableReadStream { - uint32 _size; - Common::SeekableReadStream *_stream; -public: - CBPkgFile(Common::SeekableReadStream *stream, uint32 knownLength) : _size(knownLength), _stream(stream) {} - virtual ~CBPkgFile() { - delete _stream; - } - virtual uint32 read(void *dataPtr, uint32 dataSize) { - return _stream->read(dataPtr, dataSize); - } - virtual bool eos() const { - return _stream->eos(); - } - virtual int32 pos() const { - return _stream->pos(); - } - virtual int32 size() const { - return _size; - } - virtual bool seek(int32 offset, int whence = SEEK_SET) { - return _stream->seek(offset, whence); - } -}; Common::SeekableReadStream *BaseFileEntry::createReadStream() const { Common::SeekableReadStream *file = _package->getFilePointer(); @@ -65,18 +40,13 @@ Common::SeekableReadStream *BaseFileEntry::createReadStream() const { return NULL; } - bool compressed = (_compressedLength != 0); if (compressed) { - file = Common::wrapCompressedReadStream(new Common::SeekableSubReadStream(file, _offset, _offset + _length, DisposeAfterUse::YES)); - // file = Common::wrapCompressedReadStream(new Common::SeekableSubReadStream(file, _offset, _offset + _length, DisposeAfterUse::YES), _length); // TODO: Uncomment on merge + file = Common::wrapCompressedReadStream(new Common::SeekableSubReadStream(file, _offset, _offset + _length, DisposeAfterUse::YES), _length); // } else { file = new Common::SeekableSubReadStream(file, _offset, _offset + _length, DisposeAfterUse::YES); } - if (file->size() == 0) { // TODO: Cleanup on next merge (CBPkgFile is just a placeholder for the commented out wrap above. - file = new CBPkgFile(file, _length); - } file->seek(0); -- cgit v1.2.3