typedef struct
{
+ char* unzFilePath;
char* name;
- unz_s zipinfo;
unzFile zipfile;
+ unz_file_pos zippos;
guint32 size;
} VFS_PAKFILE;
g_pakFiles = g_slist_append( g_pakFiles, file );
vfsFixDOSName( filename_inzip );
- g_strdown( filename_inzip );
+ //-1 null terminated string
+ filename_lower = g_ascii_strdown( filename_inzip, -1 );
- file->name = strdup( filename_inzip );
+ file->name = strdup( filename_lower );
file->size = file_info.uncompressed_size;
file->zipfile = uf;
- memcpy( &file->zipinfo, uf, sizeof( unz_s ) );
+ file->unzFilePath = unzFilePath;
+ file->zippos = pos;
if ( ( i + 1 ) < gi.number_entry ) {
err = unzGoToNextFile( uf );
}
if ( count == index ) {
- memcpy( file->zipfile, &file->zipinfo, sizeof( unz_s ) );
+ strcpy( g_strLoadedFileLocation, file->unzFilePath );
+ strcat( g_strLoadedFileLocation, " :: " );
+ strcat( g_strLoadedFileLocation, filename );
+
+ if ( unzGoToFilePos( file->zipfile, &file->zippos ) != UNZ_OK ) {
+ return -1;
+ }
if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) {
return -1;
}