]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/zstream.cpp
Lotta stuff for drawing etc.
[wxWidgets.git] / src / common / zstream.cpp
index 1090d6b3a297a148961138b65ca8b7eaf6219627..24f763bf289b6de153680790016a4dcb21c82d84 100644 (file)
@@ -32,7 +32,7 @@
 // If we are building with configure (defines __WX_SETUP_H__), 
 // we trust the zlib path is given as a -I option.
 #if defined(__WXMSW__) && !defined(__WX_SETUP_H__)
-   #include "..\zlib\zlib.h"
+   #include "../zlib/zlib.h"
 #else
    #include "zlib.h"
 #endif
@@ -104,7 +104,7 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size)
 // wxZlibOutputStream
 //////////////////////
 
-wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream)
+wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream, int level)
  : wxFilterOutputStream(stream)
 {
   int err;
@@ -115,7 +115,10 @@ wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream)
   m_deflate->zfree = (free_func)0;
   m_deflate->opaque = (voidpf)0;
 
-  err = deflateInit(m_deflate, Z_DEFAULT_COMPRESSION);
+  if (level == -1) level = Z_DEFAULT_COMPRESSION;
+  wxASSERT_MSG(level >= 0 && level <= 9, wxT("wxZlibOutputStream compression level must be between 0 and 9!"));
+
+  err = deflateInit(m_deflate, level);
   if (err != Z_OK) {
     deflateEnd(m_deflate);
     return;