xoreos
0.0.5
|
Loading BioWare's TLK talk tables. More...
#include <talktable_tlk.h>
Classes | |
struct | Entry |
A talk resource entry. More... | |
Public Member Functions | |
TalkTable_TLK (Common::SeekableReadStream *tlk, Common::Encoding encoding) | |
Take over this stream and read a TLK out of it. More... | |
~TalkTable_TLK () | |
uint32 | getLanguageID () const |
Return the language ID (ungendered) of the talk table. More... | |
bool | hasEntry (uint32 strRef) const |
const Common::UString & | getString (uint32 strRef) const |
const Common::UString & | getSoundResRef (uint32 strRef) const |
uint32 | getSoundID (uint32 strRef) const |
Public Member Functions inherited from Aurora::AuroraFile | |
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... | |
Public Member Functions inherited from Aurora::TalkTable | |
virtual | ~TalkTable () |
Static Public Member Functions | |
static uint32 | getLanguageID (Common::SeekableReadStream &tlk) |
static uint32 | getLanguageID (const Common::UString &file) |
Static Public Member Functions inherited from Aurora::AuroraFile | |
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... | |
Static Public Member Functions inherited from Aurora::TalkTable | |
static TalkTable * | load (Common::SeekableReadStream *tlk, Common::Encoding encoding) |
Take over this stream and read a talk table (of either format) out of it. More... | |
Private Types | |
enum | EntryFlags { kFlagTextPresent = (1 << 0), kFlagSoundPresent = (1 << 1), kFlagSoundLengthPresent = (1 << 2) } |
The entries' flags. More... | |
typedef std::vector< Entry > | Entries |
Private Member Functions | |
void | load () |
void | readEntryTableV3 (uint32 stringsOffset) |
void | readEntryTableV4 () |
void | readString (Entry &entry) const |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _tlk |
uint32 | _languageID |
Entries | _entries |
Additional Inherited Members | |
Protected Member Functions inherited from Aurora::AuroraFile | |
void | readHeader (Common::ReadStream &stream) |
Protected Member Functions inherited from Aurora::TalkTable | |
TalkTable (Common::Encoding encoding) | |
Static Protected Member Functions inherited from Aurora::AuroraFile | |
static uint32 | convertUTF16LE (uint32 x1, uint32 x2) |
Protected Attributes inherited from Aurora::AuroraFile | |
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... | |
Protected Attributes inherited from Aurora::TalkTable | |
Common::Encoding | _encoding |
Loading BioWare's TLK talk tables.
See class TalkTable for a general overview how talk tables work.
Unlike TalkTable_GFF, a TLK talk table is its own simple binary format. It has a numerical, game-local ID of the language it contains, and stores a few more optional data points per string, like a reference to a voice-over file.
There are two versions of TLK files known and supported
Definition at line 53 of file talktable_tlk.h.
|
private |
Definition at line 98 of file talktable_tlk.h.
|
private |
The entries' flags.
Enumerator | |
---|---|
kFlagTextPresent | |
kFlagSoundPresent | |
kFlagSoundLengthPresent |
Definition at line 75 of file talktable_tlk.h.
Aurora::TalkTable_TLK::TalkTable_TLK | ( | Common::SeekableReadStream * | tlk, |
Common::Encoding | encoding | ||
) |
Take over this stream and read a TLK out of it.
Definition at line 46 of file talktable_tlk.cpp.
Aurora::TalkTable_TLK::~TalkTable_TLK | ( | ) |
Definition at line 54 of file talktable_tlk.cpp.
uint32 Aurora::TalkTable_TLK::getLanguageID | ( | ) | const |
Return the language ID (ungendered) of the talk table.
Definition at line 138 of file talktable_tlk.cpp.
References _languageID.
Referenced by Engines::KotOR2::KotOR2Engine::detectLanguages(), Engines::KotOR::KotOREngine::detectLanguages(), Engines::NWN2::NWN2Engine::detectLanguages(), Engines::NWN::NWNEngine::detectLanguages(), getLanguageID(), and Engines::Jade::getTLKLanguage().
|
static |
Definition at line 170 of file talktable_tlk.cpp.
References Aurora::kLanguageInvalid, kTLKID, kVersion3, kVersion4, Aurora::AuroraFile::readHeader(), and Common::ReadStream::readUint32LE().
|
static |
Definition at line 182 of file talktable_tlk.cpp.
References getLanguageID(), Aurora::kLanguageInvalid, and Common::ReadFile::open().
Implements Aurora::TalkTable.
Definition at line 163 of file talktable_tlk.cpp.
References _entries, and Aurora::kFieldIDInvalid.
|
virtual |
Implements Aurora::TalkTable.
Definition at line 156 of file talktable_tlk.cpp.
References _entries, and Aurora::kEmptyString.
|
virtual |
Implements Aurora::TalkTable.
Definition at line 147 of file talktable_tlk.cpp.
References _entries, Aurora::kEmptyString, and readString().
|
virtual |
Implements Aurora::TalkTable.
Definition at line 142 of file talktable_tlk.cpp.
References _entries.
|
private |
Definition at line 57 of file talktable_tlk.cpp.
References _entries, Aurora::AuroraFile::_id, _languageID, _tlk, Aurora::AuroraFile::_version, Common::StackException::add(), Common::debugTag(), kTLKID, kVersion3, kVersion4, readEntryTableV3(), readEntryTableV4(), and Aurora::AuroraFile::readHeader().
Referenced by TalkTable_TLK().
|
private |
Definition at line 94 of file talktable_tlk.cpp.
References _entries, _tlk, Common::kEncodingASCII, Aurora::kFieldIDInvalid, and Common::readStringFixed().
Referenced by load().
|
private |
Definition at line 107 of file talktable_tlk.cpp.
References _entries, _tlk, and kFlagTextPresent.
Referenced by load().
|
private |
Definition at line 116 of file talktable_tlk.cpp.
References Aurora::TalkTable::_encoding, _tlk, Common::UString::empty(), Aurora::TalkTable_TLK::Entry::flags, Common::kEncodingInvalid, kFlagTextPresent, LangMan, Aurora::TalkTable_TLK::Entry::length, Aurora::TalkTable_TLK::Entry::offset, Common::readString(), and Aurora::TalkTable_TLK::Entry::text.
Referenced by getString().
|
mutableprivate |
Definition at line 105 of file talktable_tlk.h.
Referenced by getSoundID(), getSoundResRef(), getString(), hasEntry(), load(), readEntryTableV3(), and readEntryTableV4().
|
private |
Definition at line 103 of file talktable_tlk.h.
Referenced by getLanguageID(), and load().
|
private |
Definition at line 101 of file talktable_tlk.h.
Referenced by load(), readEntryTableV3(), readEntryTableV4(), readString(), and TalkTable_TLK().