Use sane smaller data types for data in section.bin (#188)

## Summary

* Update EpdFontFamily::Style to be u8 instead of u32 (saving 3 bytes
per word)
* Update layout width/height to be u16 from int
* Update page element count to be u16 from u32
* Update text block element count to be u16 from u32
* Bumped section bin version to version 8
This commit is contained in:
Dave Allie
2025-12-31 12:11:36 +10:00
committed by GitHub
parent 40f9ed485c
commit 6e9ba1006a
28 changed files with 133 additions and 129 deletions

View File

@@ -32,7 +32,7 @@ void Page::render(GfxRenderer& renderer, const int fontId, const int xOffset, co
}
bool Page::serialize(FsFile& file) const {
const uint32_t count = elements.size();
const uint16_t count = elements.size();
serialization::writePod(file, count);
for (const auto& el : elements) {
@@ -49,10 +49,10 @@ bool Page::serialize(FsFile& file) const {
std::unique_ptr<Page> Page::deserialize(FsFile& file) {
auto page = std::unique_ptr<Page>(new Page());
uint32_t count;
uint16_t count;
serialization::readPod(file, count);
for (uint32_t i = 0; i < count; i++) {
for (uint16_t i = 0; i < count; i++) {
uint8_t tag;
serialization::readPod(file, tag);