xoreos
0.0.5
|
Base class for most files found in games using BioWare's Aurora engine. More...
#include <aurorafile.h>
Public Member Functions | |
AuroraFile () | |
void | clear () |
uint32 | getID () const |
Return the file's ID. More... | |
uint32 | getVersion () const |
Return the file's version. More... | |
bool | isUTF16LE () const |
Were the ID and version encoded in little-endian UTF-16 in the file? More... | |
Static Public Member Functions | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le) |
Read the header out of a stream. More... | |
static void | readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version) |
Read the ID and version out of a stream. More... | |
static uint32 | readHeaderID (Common::ReadStream &stream) |
Read the ID out of a stream. More... | |
Protected Member Functions | |
void | readHeader (Common::ReadStream &stream) |
Static Protected Member Functions | |
static uint32 | convertUTF16LE (uint32 x1, uint32 x2) |
Protected Attributes | |
uint32 | _id |
The file's ID. More... | |
uint32 | _version |
The file's version. More... | |
bool | _utf16le |
The file's ID and version are in little-endian UTF-16. More... | |
Base class for most files found in games using BioWare's Aurora engine.
Aurora files generally start with a 4-byte human-readable ID, for example 'ERF ', followed by a 4-byte version string, like 'V1.0'. This base class reads them as big-endian 32-bit integer values. See the MKTAG() macro, as defined in src/common/endianness.h, for generating values to compare the IDs read out of a stream against.
Later games encode these ID and version values as 8-byte, little-endian UTF-16 strings instead. We automatically detect this, convert them back into the old format, and set a flag that can be queried with the method isUTF16LE().
Alternatively, AuroraFile provides static methods for reading the base header out of a stream.
Definition at line 52 of file aurorafile.h.
Aurora::AuroraFile::AuroraFile | ( | ) |
Definition at line 31 of file aurorafile.cpp.
References clear().
void Aurora::AuroraFile::clear | ( | ) |
Definition at line 35 of file aurorafile.cpp.
References _id, _utf16le, and _version.
Referenced by AuroraFile().
Definition at line 88 of file aurorafile.cpp.
Referenced by readHeader().
uint32 Aurora::AuroraFile::getID | ( | ) | const |
uint32 Aurora::AuroraFile::getVersion | ( | ) | const |
bool Aurora::AuroraFile::isUTF16LE | ( | ) | const |
Were the ID and version encoded in little-endian UTF-16 in the file?
Definition at line 49 of file aurorafile.cpp.
References _utf16le.
|
static |
Read the header out of a stream.
Definition at line 53 of file aurorafile.cpp.
References convertUTF16LE(), and Common::ReadStream::readUint32BE().
Referenced by Aurora::ERFFile::getDescription(), Aurora::TalkTable_TLK::getLanguageID(), Aurora::LTRFile::load(), Aurora::TalkTable::load(), Aurora::RIMFile::load(), Aurora::KEYFile::load(), Aurora::BZFFile::load(), Aurora::TalkTable_TLK::load(), Aurora::BIFFile::load(), Aurora::TwoDAFile::load(), Aurora::NWScript::NCSFile::load(), Aurora::ERFFile::load(), Aurora::GFF3File::loadHeader(), Aurora::GFF4File::loadHeader(), readHeader(), readHeaderID(), and Aurora::SSFFile::readSSFHeader().
|
static |
Read the ID and version out of a stream.
Definition at line 72 of file aurorafile.cpp.
References readHeader().
|
protected |
Definition at line 84 of file aurorafile.cpp.
References _id, _utf16le, _version, and readHeader().
|
static |
Read the ID out of a stream.
Definition at line 77 of file aurorafile.cpp.
References readHeader().
Referenced by Graphics::Aurora::ModelNode_DragonAge::readMAO().
|
protected |
The file's ID.
Definition at line 77 of file aurorafile.h.
Referenced by clear(), getID(), Aurora::GFF3File::getType(), Aurora::LTRFile::load(), Graphics::Aurora::PLTFile::load(), Aurora::RIMFile::load(), Aurora::KEYFile::load(), Aurora::BZFFile::load(), Aurora::TalkTable_TLK::load(), Aurora::BIFFile::load(), Aurora::TwoDAFile::load(), Aurora::NWScript::NCSFile::load(), Aurora::ERFFile::load(), Aurora::GFF3File::loadHeader(), Aurora::GFF4File::loadHeader(), readHeader(), and Aurora::SSFFile::readSSFHeader().
|
protected |
The file's ID and version are in little-endian UTF-16.
Definition at line 79 of file aurorafile.h.
Referenced by clear(), isUTF16LE(), Aurora::ERFFile::load(), and readHeader().
|
protected |
The file's version.
Definition at line 78 of file aurorafile.h.
Referenced by clear(), Aurora::ERFFile::getNameHashAlgo(), getVersion(), Aurora::LTRFile::load(), Graphics::Aurora::PLTFile::load(), Aurora::RIMFile::load(), Aurora::KEYFile::load(), Aurora::BZFFile::load(), Aurora::TalkTable_TLK::load(), Aurora::BIFFile::load(), Aurora::TwoDAFile::load(), Aurora::NWScript::NCSFile::load(), Aurora::ERFFile::load(), Aurora::GFF3File::loadHeader(), Aurora::GFF4File::loadHeader(), Aurora::KEYFile::readBIFList(), readHeader(), Aurora::KEYFile::readResList(), Aurora::ERFFile::readResources(), Aurora::SSFFile::readSSFHeader(), and Aurora::BIFFile::readVarResTable().