1
0
mirror of https://github.com/ScrelliCopter/tmx2gba.git synced 2025-02-21 03:29:25 +11:00

slightly simplify tmxlite subproject

This commit is contained in:
2024-03-28 21:42:00 +11:00
parent b06ad7cd79
commit 849ff6bcc8
4 changed files with 19 additions and 71 deletions

View File

@@ -26,9 +26,7 @@ source distribution.
*********************************************************************/
#include <pugixml.hpp>
#ifdef USE_ZSTD
# include <zstd.h>
#endif
#include <zstd.h>
#include "base64.h"
#include "tmxlite/FreeFuncs.hpp"
#include "tmxlite/TileLayer.hpp"
@@ -128,7 +126,6 @@ void TileLayer::parseBase64(const pugi::xml_node& node)
byteData.insert(byteData.end(), dataString.begin(), dataString.end());
break;
case CompressionType::Zstd:
#if defined USE_ZSTD
{
std::size_t dataSize = dataString.length() * sizeof(unsigned char);
std::size_t result = ZSTD_decompress(byteData.data(), expectedSize, &dataString[0], dataSize);
@@ -140,10 +137,6 @@ void TileLayer::parseBase64(const pugi::xml_node& node)
}
}
break;
#else
Logger::log("Library must be built with USE_ZSTD for Zstd compression", Logger::Type::Error);
return {};
#endif
case CompressionType::GZip:
#ifndef USE_ZLIB
Logger::log("Library must be built with USE_ZLIB for GZip compression", Logger::Type::Error);