Fix compression for fbx

This commit is contained in:
Kim Kulling
2022-02-12 09:25:45 +01:00
parent 23b43d1825
commit 3e09d462fa
7 changed files with 88 additions and 55 deletions

View File

@@ -130,13 +130,13 @@ void XGLImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
#else
std::unique_ptr<StreamReaderLE> raw_reader(new StreamReaderLE(stream));
Compression c;
Compression compression;
size_t total = 0l;
if (c.open(Compression::Format::Binary)) {
if (compression.open(Compression::Format::Binary, Compression::FlushMode::NoFlush)) {
// skip two extra bytes, zgl files do carry a crc16 upfront (I think)
raw_reader->IncPtr(2);
total = c.decompress((unsigned char *)raw_reader->GetPtr(), raw_reader->GetRemainingSize(), uncompressed);
c.close();
total = compression.decompress((unsigned char *)raw_reader->GetPtr(), raw_reader->GetRemainingSize(), uncompressed);
compression.close();
}
// replace the input stream with a memory stream
stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t *>(uncompressed.data()), total));