71 if (
_tws->readUint32BE() == 0xEE7C4A60)
72 throw Common::Exception(
"TheWitcherSaveFile::load() Invalid value, should be 0xEE7C4A60");
73 if (
_tws->readUint32BE() == 0x459E4568)
74 throw Common::Exception(
"TheWitcherSaveFile::load() Invalid value, should be 0x459E4568");
75 if (
_tws->readUint32BE() == 0x10D3DBBD)
76 throw Common::Exception(
"TheWitcherSaveFile::load() Invalid value, should be 0x10D3DBBD");
77 if (
_tws->readUint32BE() == 0x1CBCF20B)
78 throw Common::Exception(
"TheWitcherSaveFile::load() Invalid value, should be 0x1CBCF20B");
82 if (lightningStorm !=
"Lightning Storm")
88 if (areaName1 != areaName2)
97 _tws->seek(resourceOffset);
99 for (
uint32 i = 0; i < resourceCount; ++i) {
117 if (iResource.
offset < dataOffset)
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
#define TypeMan
Shortcut for accessing the file type manager.
static int readStream(void *context, char *buffer, int len)
const Common::UString & getAreaName() const
Get the area name of this save file.
A class holding an UTF-8 string.
Utility functions to handle files used in BioWare's Aurora engine.
UTF-16 LE (little endian).
Common::UString name
The resource's name.
ResourceList _resourceList
Exception that provides a stack of explanations.
Seek from the end of the stream.
const ResourceList & getResources() const
Return the list of resources.
void replaceAll(uint32 what, uint32 with)
Replace all occurrences of a character with another character.
Handling TheWitcherSave Archives.
std::list< Resource > ResourceList
uint32 getResourceSize(uint32 index) const
Get the resource size.
A resource within the archive.
TheWitcherSaveFile(Common::SeekableReadStream *tws)
PointerType get() const
Returns the plain pointer value.
Common::SeekableReadStream * getResource(uint32 index, bool tryNoCopy=false) const
Return a stream of the resource's contents.
FileType type
The resource's type.
static const uint32 kRGMHID
Common::ScopedPtr< Common::SeekableReadStream > _tws
UString readStringFixed(SeekableReadStream &stream, Encoding encoding, size_t length)
Read length bytes as a string with the given encoding out of a stream.
SeekableSubReadStream provides access to a SeekableReadStream restricted to the range [begin...
Interface for a seekable & readable data stream.
uint32 index
The resource's local index within the archive.
Common::UString _areaName
std::vector< IResource > _resources