diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/base/file/base_file_entry.cpp | 32 |
1 files changed, 1 insertions, 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);
|