diff options
author | Einar Johan Trøan Sømåen | 2012-08-13 02:19:41 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-08-13 02:19:41 +0200 |
commit | 4168b50fc3951cb716597ed8bf559d883828ff1a (patch) | |
tree | 7ae3d3482dec888e9c11cc11d6a09bc811cf3197 /engines | |
parent | 61ddc77804279a28f3dc8ebef4c226c78816d689 (diff) | |
download | scummvm-rg350-4168b50fc3951cb716597ed8bf559d883828ff1a.tar.gz scummvm-rg350-4168b50fc3951cb716597ed8bf559d883828ff1a.tar.bz2 scummvm-rg350-4168b50fc3951cb716597ed8bf559d883828ff1a.zip |
WINTERMUTE: Remove BPkgFile, as wrapCompressedStream can handle that job now.
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);
|