diff options
Diffstat (limited to 'engines/adl/disk.cpp')
| -rw-r--r-- | engines/adl/disk.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/adl/disk.cpp b/engines/adl/disk.cpp index b91efec1f1..e2c3da3d5c 100644 --- a/engines/adl/disk.cpp +++ b/engines/adl/disk.cpp @@ -21,6 +21,7 @@ */ #include "common/stream.h" +#include "common/substream.h" #include "adl/disk.h" @@ -87,4 +88,24 @@ bool DiskImage_DSK::open(const Common::String &filename) { return true; } +Common::SeekableReadStream *FilesDataBlock::createReadStream() const { + return _files->createReadStream(_filename, _offset); +} + +const DataBlockPtr PlainFiles::getDataBlock(const Common::String &filename, uint offset) const { + return Common::SharedPtr<FilesDataBlock>(new FilesDataBlock(this, filename, offset)); +} + +Common::SeekableReadStream *PlainFiles::createReadStream(const Common::String &filename, uint offset) const { + Common::File *f(new Common::File()); + + if (!f->open(filename)) + error("Failed to open '%s'", filename.c_str()); + + if (offset == 0) + return f; + else + return new Common::SeekableSubReadStream(f, offset, f->size(), DisposeAfterUse::YES); +} + } // End of namespace Adl |
