25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/file.h" 28 #include "common/memstream.h" 29 #include "common/savefile.h" 30 #include "common/serializer.h" 31 #include "common/str-array.h" 32 #include "graphics/surface.h" 45 #define SYNC_AS(SUFFIX,STREAM,TYPE,SIZE) \ 46 template<typename T> \ 47 void syncAs ## SUFFIX(T &val, Version minVersion = 0, Version maxVersion = kLastVersion) { \ 48 if (_version < minVersion || _version > maxVersion) \ 51 val = static_cast<TYPE>(_loadStream->read ## STREAM()); \ 53 TYPE tmp = (TYPE)val; \ 54 _saveStream->write ## STREAM(tmp); \ 56 _bytesSynced += SIZE; \ 68 CCEntry() : _id(0), _offset(0), _size(0), _writeOffset(0) {}
69 CCEntry(uint16
id, uint32 offset, uint32 size)
70 : _id(
id), _offset(offset), _size(size) {
101 void setGameCc(
int ccMode);
123 static CCArchive *_xeenCc, *_darkCc, *_introCc;
131 static void setCurrentArchive(
int ccMode);
217 _parentStream(parentStream), _begin(parentStream->
pos()) {
220 uint32
write(
const void *dataPtr, uint32 dataSize)
override {
221 return _parentStream->
write(dataPtr, dataSize);
225 int64
pos()
const override {
return _parentStream->
pos() - _begin; }
252 SYNC_AS(Sint8, Byte, int8, 1)
255 if (_in && _filesize == -1)
256 _filesize = _in->
size();
257 return _in !=
nullptr && _in->
pos() >= _filesize;
288 virtual bool getHeaderEntry(uint16
id,
CCEntry &ccEntry)
const;
293 static uint16 convertNameToId(
const Common::String &resourceName);
366 void replaceEntry(uint16
id,
const byte *data,
size_t size);
385 void finalize()
override;
390 uint32 write(
const void *dataPtr, uint32 dataSize)
override;
395 int64 pos()
const override;
bool flush() override
Definition: files.h:223
virtual int64 size() const =0
int64 pos() const override
Definition: files.h:225
void finalize() override
Definition: files.h:224
virtual int64 pos() const =0
uint32 write(const void *dataPtr, uint32 dataSize) override
Definition: files.h:220
virtual bool open(const Path &filename)
Definition: memstream.h:179
virtual bool flush()
Definition: stream.h:101
Definition: debugger.h:32
Definition: serializer.h:79
Definition: archive.h:101
virtual int64 pos() const =0
Array< String > StringArray
Definition: str-array.h:43
virtual uint32 write(const void *dataPtr, uint32 dataSize)=0
bool open(const Common::FSNode &node) override
Definition: files.h:162
Definition: character.h:33
bool open(SeekableReadStream *stream, const Common::String &name) override
Definition: files.h:169