diff options
Diffstat (limited to 'engines/tinsel/drives.h')
-rw-r--r-- | engines/tinsel/drives.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/tinsel/drives.h b/engines/tinsel/drives.h index 81111265fa..061dae625f 100644 --- a/engines/tinsel/drives.h +++ b/engines/tinsel/drives.h @@ -27,6 +27,8 @@ #ifndef TINSEL_DRIVES_H #define TINSEL_DRIVES_H +#include "common/memstream.h" +#include "common/substream.h" #include "common/file.h" #include "tinsel/dw.h" #include "tinsel/coroutine.h" @@ -59,12 +61,29 @@ void SetNextCD(int cdNumber); bool GotoCD(); -class TinselFile: public Common::File { +class TinselFile { private: static bool _warningShown; + Common::SeekableSubReadStreamEndian *_stream; + bool openInternal(const Common::String &filename); public: - virtual bool open(const Common::String &filename); + TinselFile(); + ~TinselFile(); + bool open(const Common::String &filename); + void close(); char getCdNumber(); + + FORCEINLINE int32 pos() const { assert(_stream); return _stream->pos(); } + FORCEINLINE int32 size() const { assert(_stream); return _stream->size(); } + FORCEINLINE bool seek(int32 offset, int whence = SEEK_SET) { assert(_stream); return _stream->seek(offset, whence); } + FORCEINLINE bool eos() const { assert(_stream); return _stream->eos(); } + FORCEINLINE bool err() const { return _stream->err(); } + FORCEINLINE uint32 readUint32() { assert(_stream); return _stream->readUint32(); } + FORCEINLINE int16 readSint16() { assert(_stream); return _stream->readUint16(); } + FORCEINLINE int32 readSint32() { assert(_stream); return _stream->readUint32(); } + FORCEINLINE Common::SeekableReadStream *readStream(uint32 dataSize) { assert(_stream); return _stream->readStream(dataSize); } + FORCEINLINE uint32 read(void *dataPtr, uint32 dataSize) { assert(_stream); return _stream->read(dataPtr, dataSize); } + FORCEINLINE bool skip(uint32 offset) { return seek(offset, SEEK_CUR); } }; |