diff options
author | Max Horn | 2008-09-13 16:51:46 +0000 |
---|---|---|
committer | Max Horn | 2008-09-13 16:51:46 +0000 |
commit | 655ce26b3f09628d9408a4d82efe3a26116999fe (patch) | |
tree | 779a25dbe25c8f916fb385b3dd2d48e0e379d9ec /engines/gob | |
parent | b86a047164b54c20366fcbe21b55bf63f2ced5f4 (diff) | |
download | scummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.tar.gz scummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.tar.bz2 scummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.zip |
Big patch changing the signature of various Stream methods (some ports may need to be slightly tweaked to fix overloading errors/warnings)
svn-id: r34514
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/dataio.cpp | 20 | ||||
-rw-r--r-- | engines/gob/dataio.h | 6 | ||||
-rw-r--r-- | engines/gob/saveload.cpp | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index bcf566d134..0a3f317ada 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -62,31 +62,33 @@ DataStream::~DataStream() { } } -uint32 DataStream::pos() const { +int32 DataStream::pos() const { if (_stream) return _stream->pos(); - uint32 resPos = _io->getChunkPos(_handle); - if (resPos != 0xFFFFFFFF) + int32 resPos = _io->getChunkPos(_handle); + if (resPos != -1) return resPos; return _io->file_getHandle(_handle)->pos(); } -uint32 DataStream::size() const { +int32 DataStream::size() const { if (_stream) return _stream->size(); return _size; } -void DataStream::seek(int32 offset, int whence) { +bool DataStream::seek(int32 offset, int whence) { if (_stream) - _stream->seek(offset, whence); + return _stream->seek(offset, whence); else if ((_handle < 50) || (_handle >= 128)) - _io->file_getHandle(_handle)->seek(offset, whence); - else - _io->seekChunk(_handle, offset, whence); + return _io->file_getHandle(_handle)->seek(offset, whence); + else { + _io->seekChunk(_handle, offset, whence); + return true; + } } bool DataStream::eos() const { diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h index 4b4c79d1eb..c67dc89df8 100644 --- a/engines/gob/dataio.h +++ b/engines/gob/dataio.h @@ -45,10 +45,10 @@ public: DataStream(byte *buf, uint32 dSize, bool dispose = true); virtual ~DataStream(); - virtual uint32 pos() const; - virtual uint32 size() const; + virtual int32 pos() const; + virtual int32 size() const; - virtual void seek(int32 offset, int whence = SEEK_SET); + virtual bool seek(int32 offset, int whence = SEEK_SET); virtual bool eos() const; diff --git a/engines/gob/saveload.cpp b/engines/gob/saveload.cpp index fa9f8ea7a9..e3212ac8ff 100644 --- a/engines/gob/saveload.cpp +++ b/engines/gob/saveload.cpp @@ -513,7 +513,7 @@ bool StagedSave::read() { return false; } - uint32 saveSize = getSize(); + int32 saveSize = getSize(); if (in->size() != saveSize) { warning("Wrong size (%d != %d)", in->size(), saveSize); return false; |