overte-thingvellir/cmake/ports/artery-font-format/disable-checksum.patch
2024-06-18 21:08:21 -07:00

38 lines
1.8 KiB
Diff

diff --git a/artery-font/serialization.hpp b/artery-font/serialization.hpp
index 69263a8..6075eda 100644
--- a/artery-font/serialization.hpp
+++ b/artery-font/serialization.hpp
@@ -109,15 +109,16 @@ template <ReadFunction READ, typename REAL, template <typename> class LIST, clas
bool decode(ArteryFont<REAL, LIST, BYTE_ARRAY, STRING> &font, void *userData) {
uint32 totalLength = 0;
uint32 prevLength = 0;
- uint32 checksum = crc32Init();
+ //uint32 checksum = crc32Init();
byte dump[4];
#define ARTERY_FONT_DECODE_READ(target, len) { \
if (READ((target), (len), userData) != int(len)) \
return false; \
totalLength += (len); \
- for (int _i = 0; _i < int(len); ++_i) \
- checksum = crc32Update(checksum, reinterpret_cast<const byte *>(target)[_i]); \
}
+ // for (int _i = 0; _i < int(len); ++_i) \
+ // checksum = crc32update(checksum, reinterpret_cast<const byte *>(target)[_i]); \
+ //}
#define ARTERY_FONT_DECODE_REALIGN() { \
if (totalLength&0x03u) { \
uint32 len = 0x04u-(totalLength&0x03u); \
@@ -228,10 +229,10 @@ bool decode(ArteryFont<REAL, LIST, BYTE_ARRAY, STRING> &font, void *userData) {
ARTERY_FONT_DECODE_READ(&footer, sizeof(footer)-sizeof(footer.checksum));
if (footer.magicNo != ARTERY_FONT_FOOTER_MAGIC_NO)
return false;
- uint32 finalChecksum = checksum;
+ //uint32 finalChecksum = checksum;
ARTERY_FONT_DECODE_READ(&footer.checksum, sizeof(footer.checksum));
- if (footer.checksum != finalChecksum)
- return false;
+ //if (footer.checksum != finalChecksum)
+ // return false;
if (totalLength != footer.totalLength)
return false;
}