15 uint32_t*
tmj_decode_layer(
const char* data,
const char* encoding,
const char* compression,
size_t* size) {
16 if (strcmp(encoding,
"base64") != 0) {
34 if (strcmp(compression,
"zlib") == 0 || strcmp(compression,
"gzip") == 0) {
36 logmsg(
TMJ_LOG_ERR,
"Layer data encoded with %s, but libtmj was not compiled with %s support", compression, compression);
46 if (strcmp(compression,
"zstd") == 0) {
48 logmsg(
TMJ_LOG_ERR,
"Layer data encoded with zstd, but libtmj was not compiled with zstd support");
69 return (uint32_t*)dat2;
uint8_t * tmj_zlib_decompress(const uint8_t *data, size_t data_size, size_t *decompressed_size)
Decompresses a zlib/gzip-compressed buffer of bytes.
uint8_t * tmj_b64_decode(const char *data, size_t *decoded_size)
Decodes a base64 string.
uint8_t * tmj_zstd_decompress(const uint8_t *data, size_t data_size, size_t *decompressed_size)
Decompresses a zstd-compressed buffer of bytes.
void logmsg(tmj_log_priority priority, char *msg,...)
Processes log messages and passes them to the active logging callback, if there is one.
uint32_t * tmj_decode_layer(const char *data, const char *encoding, const char *compression, size_t *size)
Decodes layer data from a Tiled map layer.
const char *const TMJ_VERSION
The full library version.
const unsigned int TMJ_VERSION_MINOR
The library minor version.
const unsigned int TMJ_VERSION_PATCH
The library patch version.
const unsigned int TMJ_VERSION_MAJOR
**