1
16122002, Thomas.Eder@nmi.at, Using the zziplib library with SDL
7
zziplib 0.10.66 (preview), SDL 1.2.5, Win32, MSVC6
10
zziplib.sourceforge.net (zziplib-0.10.66.tar.gz)
11
www.libsdl.org (SDL-devel-1.2.5a-VC6.zip)
13
Also you have to get zlib, I used
14
from SDL_image-1.2.2.zip in VisualC.zip:
15
zlib.lib (12.7.1998, 34674 bytes)
16
zlib.h ( 9.7.1998, 41791 bytes, 1.1.3)
17
zconf.h ( 8.7.1998, 8089 bytes)
19
from SDL_image-devel-1.2.2-VC6.zip:
20
zlib.dll ( 5.4.2001, 53760 bytes, 1.1.3.1)
22
Maybe you should get the latest version (currently 1.1.4) from
23
http://gnuwin32.sourceforge.net/install.html
24
(see notes at end of page!)
27
CREATING zzlib.dll/zzlib.lib
29
Copy your versions of zlib.lib, zlib.h and zconf.h to the zzlib
31
In MSVC (start zziplib.dsw)
32
Add zlib.lib to the files for the zziplib_DLL project.
33
Add ZLIB_DLL to the preprocessor definitions.
35
Set the active project and the active configuration to create zziplib.dll
36
and zziplib.lib (I created and used the release version).
41
Include/add the following files to your SDL-Project
42
(put them in proper directories, etc.):
62
you may also want to use
67
For compiling it should be sufficient to use
69
in the files where you use zziplib-functions.
74
It is possible to use both original (unzipped) and zipped versions of files,
75
and zziplib will take one of them (depending on the modes when calling
78
But this didnt work for all of my original files, so I suggest using zipped
79
files only (and remove the original unzipped files, so zziplib doesnt try to
80
open the original version).
85
When opening many files from a zip, its faster to open the zip-directory
86
only once, and not for every file access. You may want to modify
87
SDL_rwops_zzip for this to get code like:
92
SDL_Surface* temp1 = NULL; //default > NULL > error
93
SDL_Surface* temp2 = NULL; //default > NULL > error
95
//last param may be used for err return
96
ZZIP_DIR* zzipdir = zzip_dir_open( "figures.zip", NULL );
98
ZZIP_FILE* zfile = zzip_file_open(zzipdir, "f1.bmp", ZZIP_CASELESS);
102
rw = SDL_RWFromZZIP(zfile); //modified version
105
temp1 = IMG_Load_RW(rw, 0);
108
int zret = zzip_file_close( zfile );
111
zfile = zzip_file_open(zzipdir, "f2.bmp", ZZIP_CASELESS);
114
rw = SDL_RWFromZZIP(zfile); //modified version
117
temp2 = IMG_Load_RW(rw, 0);
120
int zret = zzip_file_close( zfile );
125
zzip_dir_close( zzipdir );