Skip to content

Commit

Permalink
AURORA: Also use available shared strings for GFF4 TalkString fields
Browse files Browse the repository at this point in the history
When the GFF4 file has a shared strings table, the strings in the
TalkString also refer into this table.
  • Loading branch information
DrMcCoy committed Nov 12, 2016
1 parent fe5151a commit 01c893c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/aurora/gff4file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,12 @@ bool GFF4Struct::getTalkString(uint32 field, Common::Encoding encoding,
const uint32 offset = getUint(*data, kFieldTypeUint32);

str.clear();
if ((offset != 0xFFFFFFFF) && (offset != 0))
str = getString(*data, encoding, _parent->getDataOffset() + offset);
if (offset != 0xFFFFFFFF) {
if (_parent->hasSharedStrings())
str = _parent->getSharedString(offset);
else if (offset != 0)
str = getString(*data, encoding, _parent->getDataOffset() + offset);
}

return true;
}
Expand Down Expand Up @@ -1203,8 +1207,13 @@ bool GFF4Struct::getTalkString(uint32 field, Common::Encoding encoding,
strRefs[i] = getUint(*data, kFieldTypeUint32);

const uint32 offset = getUint(*data, kFieldTypeUint32);
if ((offset != 0xFFFFFFFF) && (offset != 0))
strs[i] = getString(*data, encoding, _parent->getDataOffset() + offset);

if (offset != 0xFFFFFFFF) {
if (_parent->hasSharedStrings())
strs[i] = _parent->getSharedString(offset);
else if (offset != 0)
strs[i] = getString(*data, encoding, _parent->getDataOffset() + offset);
}
}

return true;
Expand Down

0 comments on commit 01c893c

Please sign in to comment.