From 172aef0c9d0e2e4e75931da57f872bc0b86d47c4 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 11 Jul 2022 14:20:56 -0700 Subject: [PATCH] lib: implement FLC de-chunking --- lib/object.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/object.cpp b/lib/object.cpp index de584c3..5491b25 100644 --- a/lib/object.cpp +++ b/lib/object.cpp @@ -152,6 +152,24 @@ bytearray Object::ToPackedData(MxOb::FileType filetype, const ChunkedData &chunk *(uint32_t*)(data.data()+10) = chunks.at(0).size() + 14; break; } + case MxOb::FLC: + { + // First chunk is a complete FLIC header, so add it as-is + data.append(chunks[0]); + + // Subsequent chunks are FLIC frames with an additional 20 byte header that needs to be stripped + const int CUSTOM_HEADER_SZ = 20; + for (size_t i=1; i