summaryrefslogtreecommitdiffstats
path: root/src/compression.c
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-02-19 22:44:38 (EST)
committer P. J. McDermott <pjm@nac.net>2013-02-19 22:44:38 (EST)
commit35226d81ac2db45ce514f07d9be60b1dee5d88fe (patch)
treea832d9ee8d8d733080407f23eac392525600771d /src/compression.c
parent22357decdbdd612a00bcfa9291b767e6f068fd9f (diff)
downloadoverworld-rpg-35226d81ac2db45ce514f07d9be60b1dee5d88fe.zip
overworld-rpg-35226d81ac2db45ce514f07d9be60b1dee5d88fe.tar.gz
overworld-rpg-35226d81ac2db45ce514f07d9be60b1dee5d88fe.tar.bz2
Disable TMX parser debugging noise by default.
Diffstat (limited to 'src/compression.c')
-rw-r--r--src/compression.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compression.c b/src/compression.c
index 2dac4e5..b7c8307 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
+#include "../config.h"
#include "compression.h"
#include "logging.h"
@@ -48,13 +49,19 @@ decompress(char *src, size_t src_len, char *dest, size_t dest_len)
d_stream.next_out = (Bytef *) dest;
d_stream.avail_out = dest_len;
+#ifdef DEBUG_COMPRESSION
debug("Initializing inflation stream...");
+#endif
zlib_err(inflateInit2(&d_stream, 15 + 32));
+#ifdef DEBUG_COMPRESSION
debug("Inflating %d bytes into up to %d bytes...", src_len, dest_len);
+#endif
zlib_err(inflate(&d_stream, Z_NO_FLUSH));
+#ifdef DEBUG_COMPRESSION
debug("Ending inflation stream...");
+#endif
zlib_err(inflateEnd(&d_stream));
}