+ if (m_z_buffer) {
+ m_inflate = new z_stream_s;
+
+ if (m_inflate) {
+ memset(m_inflate, 0, sizeof(z_stream_s));
+
+ // see zlib.h for documentation on windowBits
+ int windowBits = MAX_WBITS;
+ switch (flags) {
+ case wxZLIB_NO_HEADER: windowBits = -MAX_WBITS; break;
+ case wxZLIB_ZLIB: windowBits = MAX_WBITS; break;
+ case wxZLIB_GZIP: windowBits = MAX_WBITS | ZSTREAM_GZIP; break;
+ case wxZLIB_AUTO: windowBits = MAX_WBITS | ZSTREAM_AUTO; break;
+ default: wxFAIL_MSG(wxT("Invalid zlib flag"));
+ }
+
+ if (inflateInit2(m_inflate, windowBits) == Z_OK)
+ return;
+ }
+ }