diff options
author | Eugene Sandulenko | 2013-06-20 17:21:37 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2013-09-06 14:48:14 +0300 |
commit | 925f41b9c4055d39498c61c8f22388176ee25cce (patch) | |
tree | f82d06ee8ba7c3fc3c570ed3ab0036c624c5bc68 /engines/fullpipe/utils.h | |
parent | bb4ea153ffa5eaf5be3e912e206566f7c9278a87 (diff) | |
download | scummvm-rg350-925f41b9c4055d39498c61c8f22388176ee25cce.tar.gz scummvm-rg350-925f41b9c4055d39498c61c8f22388176ee25cce.tar.bz2 scummvm-rg350-925f41b9c4055d39498c61c8f22388176ee25cce.zip |
FULLPIPE: Made MfcArchive work with both files and archives
Diffstat (limited to 'engines/fullpipe/utils.h')
-rw-r--r-- | engines/fullpipe/utils.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 409c5ded1a..b349fc305d 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -33,7 +33,7 @@ class CObject; typedef Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ClassMap; -class MfcArchive : public Common::File { +class MfcArchive : public Common::SeekableReadStream { ClassMap _classMap; Common::Array<CObject *> _objectMap; Common::Array<int> _objectIdMap; @@ -41,8 +41,10 @@ class MfcArchive : public Common::File { int _lastIndex; int _level; + Common::SeekableReadStream *_stream; + public: - MfcArchive(); + MfcArchive(Common::SeekableReadStream *file); char *readPascalString(bool twoByte = false); int readCount(); @@ -53,6 +55,12 @@ class MfcArchive : public Common::File { void incLevel() { _level++; } void decLevel() { _level--; } int getLevel() { return _level; } + + virtual bool eos() const { return _stream->eos(); } + virtual uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); } + virtual int32 pos() const { return _stream->pos(); } + virtual int32 size() const { return _stream->size(); } + virtual bool seek(int32 offset, int whence = SEEK_SET) { return _stream->seek(offset, whence); } }; class CObject { |