2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 20:27:42 +00:00

Added binarySize method to DNA implementations

This commit is contained in:
Jack Andersen
2015-10-17 18:08:45 -10:00
parent 6bd5c42a9e
commit 9529fad78f
21 changed files with 668 additions and 15 deletions

View File

@@ -199,6 +199,10 @@ struct MaterialSet : BigDNA
writer.writeUBytes((atUint8*)&section->m_type, 4);
section->write(writer);
}
size_t binarySize(size_t __isz) const
{
return section->binarySize(__isz + 4);
}
};
std::vector<SectionFactory> sections;
void read(Athena::io::IStreamReader& reader)
@@ -218,6 +222,13 @@ struct MaterialSet : BigDNA
section.write(writer);
writer.writeUBytes((atUint8*)"END ", 4);
}
size_t binarySize(size_t __isz) const
{
__isz = header.binarySize(__isz);
for (const SectionFactory& section : sections)
__isz = section.binarySize(__isz);
return __isz + 4;
}
};
Vector<Material, DNA_COUNT(materialCount)> materials;