Merge branch 'TimePath/gtk++' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Aug 2017 10:51:11 +0000 (10:51 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Aug 2017 10:51:11 +0000 (10:51 +0000)
GTK Upgrade

See merge request !59

1  2 
tools/quake3/common/vfs.c

index 0c3ca69f9535406330c0aa9ba3a3b05cabd2826a,cf5d0d79c15f7f0c3228c930d77a8a112ec57fc6..775f9bd0e8c56a19a496e5ced060f7d7e5a84011
  #include "inout.h"
  #include "vfs.h"
  #include <minizip/unzip.h>
+ #include <glib.h>
  
  typedef struct
  {
        char*   name;
        unzFile zipfile;
 +      unz_file_pos zippos;
        guint32 size;
  } VFS_PAKFILE;
  
@@@ -129,11 -129,6 +130,11 @@@ static void vfsInitPakFile( const char 
                if ( err != UNZ_OK ) {
                        break;
                }
 +              unz_file_pos pos;
 +              err = unzGetFilePos( uf, &pos );
 +              if ( err != UNZ_OK ) {
 +                      break;
 +              }
  
                file = (VFS_PAKFILE*)safe_malloc( sizeof( VFS_PAKFILE ) );
                g_pakFiles = g_slist_append( g_pakFiles, file );
                file->name = strdup( filename_inzip );
                file->size = file_info.uncompressed_size;
                file->zipfile = uf;
 +              file->zippos = pos;
  
                if ( ( i + 1 ) < gi.number_entry ) {
                        err = unzGoToNextFile( uf );
@@@ -390,9 -384,6 +391,9 @@@ int vfsLoadFile( const char *filename, 
  
                if ( count == index ) {
  
 +            if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) {
 +                return -1;
 +            }
                        if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) {
                                return -1;
                        }