mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 15:47:46 +00:00
Added binarySize method to DNA implementations
This commit is contained in:
@@ -109,6 +109,28 @@ void STRG::write(Athena::io::IStreamWriter& writer) const
|
||||
}
|
||||
}
|
||||
|
||||
size_t STRG::binarySize(size_t __isz) const
|
||||
{
|
||||
__isz += 16;
|
||||
__isz += langs.size() * 12;
|
||||
|
||||
size_t strCount = STRG::count();
|
||||
__isz += langs.size() * strCount * 4;
|
||||
for (const std::pair<FourCC, std::vector<std::wstring>>& lang : langs)
|
||||
{
|
||||
atUint32 langStrCount = lang.second.size();
|
||||
for (atUint32 s=0 ; s<strCount ; ++s)
|
||||
{
|
||||
if (s < langStrCount)
|
||||
__isz += (lang.second[s].size() + 1) * 2;
|
||||
else
|
||||
__isz += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return __isz;
|
||||
}
|
||||
|
||||
void STRG::fromYAML(Athena::io::YAMLDocReader& reader)
|
||||
{
|
||||
const Athena::io::YAMLNode* root = reader.getRootNode();
|
||||
|
||||
Reference in New Issue
Block a user