JujuAdams / SNAP

Data format converters for GameMaker LTS 2022
MIT License
88 stars 15 forks source link

new function SnapBufferMeasureBinary #36

Closed Grisgram closed 1 year ago

Grisgram commented 1 year ago

Hey

when writing a struct of unknown size (like a savegame) to a binary buffer it is useful to know, how large the buffer shall be allocated to avoid too many resizing operations. This function does not write to the buffer, it just counts, how much would be written, taking into account the null-terminator characters for strings, your marker bytes and all that stuff. it's more or less a copy of SnapBufferWriteBinary, where all write-operations are replaced by length-counting.

return value is an integer (number of bytes).

hope u like it, cheers, Gris

Grisgram commented 1 year ago

wtf why are there almost 100 files changed?? wait a minute, i try to get that better...

Grisgram commented 1 year ago

please close and ignore this one -- no idea why my studio replaces all your files - i try a clean commit containing only the new function