aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2016-04-03 09:18:04 +0200
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commitd6f34eda997ef5ace7078ac6d944ac505bb2a35d (patch)
treeb7f49104f7dd64dcf56b9d797899bb39cef394b8
parent1b9d712a8b68f75dcd7c22021b50fff1eeaec155 (diff)
downloadscummvm-rg350-d6f34eda997ef5ace7078ac6d944ac505bb2a35d.tar.gz
scummvm-rg350-d6f34eda997ef5ace7078ac6d944ac505bb2a35d.tar.bz2
scummvm-rg350-d6f34eda997ef5ace7078ac6d944ac505bb2a35d.zip
ADL: Remove DataBlockPtr::isValid()
-rw-r--r--engines/adl/disk.h9
-rw-r--r--engines/adl/hires2.cpp5
2 files changed, 4 insertions, 10 deletions
diff --git a/engines/adl/disk.h b/engines/adl/disk.h
index 12801ec9e7..4cab81d720 100644
--- a/engines/adl/disk.h
+++ b/engines/adl/disk.h
@@ -38,7 +38,6 @@ class DataBlock {
public:
virtual ~DataBlock() { }
- virtual bool isValid() const = 0;
virtual Common::SeekableReadStream *createReadStream() const = 0;
};
@@ -60,10 +59,6 @@ protected:
_filename(filename),
_offset(offset) { }
- bool isValid() const {
- return true;
- }
-
Common::SeekableReadStream *createReadStream() const {
return _files->createReadStream(_filename, _offset);
}
@@ -102,10 +97,6 @@ protected:
_size(size),
_disk(disk) { }
- bool isValid() const {
- return _track != 0 || _sector != 0 || _offset != 0 || _size != 0;
- }
-
Common::SeekableReadStream *createReadStream() const {
return _disk->createReadStream(_track, _sector, _offset, _size);
}
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 4ac8e88fa0..70b98b9a06 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -42,6 +42,9 @@ DataBlockPtr HiRes2Engine::readDataBlockPtr(Common::ReadStream &f) const {
if (f.eos() || f.err())
error("Error reading DataBlockPtr");
+ if (track == 0 && sector == 0 && offset == 0 && size == 0)
+ return DataBlockPtr();
+
return _disk.getDataBlock(track, sector, offset, size);
}
@@ -70,7 +73,7 @@ void HiRes2Engine::init() {
for (uint i = 0; i < IDI_HR2_NUM_MESSAGES; ++i) {
DataBlockPtr str(readDataBlockPtr(*stream));
- if (str->isValid()) {
+ if (str) {
StreamPtr strStream(str->createReadStream());
_messages.push_back(readString(*strStream, 0xff));
} else {