re-enable copying deflated zips, inflateCopy is widespread enough
authorPatrick McIlroy <itgpmc@gmail.com>
Sat, 30 May 2009 04:05:06 +0000 (04:05 +0000)
committerPatrick McIlroy <itgpmc@gmail.com>
Sat, 30 May 2009 04:05:06 +0000 (04:05 +0000)
git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@671 83fadc84-e282-4d84-a09a-c4228d6ae7e5

src/RageFileDriverDeflate.cpp

index 44287cf..a843c33 100755 (executable)
@@ -47,27 +47,26 @@ RageFileObjInflate::RageFileObjInflate( const RageFileObjInflate &cpy ):
        /* XXX completely untested */
        /* Copy the entire decode state. */
        /* inflateInit2 isn't widespread yet */
-       ASSERT( 0 );
-/*
+       //ASSERT( 0 );
+
        m_pFile = cpy.m_pFile->Copy();
        m_bFileOwned = true;
        m_pInflate = new z_stream;
        inflateCopy( m_pInflate, const_cast<z_stream*>(cpy.m_pInflate) );
+       m_iUncompressedSize = cpy.m_iUncompressedSize;
 
-       // memcpy decomp_buf?
        decomp_buf_ptr = decomp_buf + (cpy.decomp_buf_ptr - cpy.decomp_buf);
        decomp_buf_avail = cpy.decomp_buf_avail;
+       memcpy( decomp_buf, cpy.decomp_buf, decomp_buf_avail );\r
        m_iFilePos = cpy.m_iFilePos;
-       */
 }
 
 RageFileBasic *RageFileObjInflate::Copy() const
 {
-       RageException::Throw( "Loading ZIPs from deflated ZIPs is currently disabled; see RageFileObjInflate" );
+       //RageException::Throw( "Loading ZIPs from deflated ZIPs is currently disabled; see RageFileObjInflate" );
 
-       // return new RageFileObjInflate( *this, p );
+       return new RageFileObjInflate( *this );
 }
-       
 
 RageFileObjInflate::~RageFileObjInflate()
 {