2 The following instructions are outdated.
3 They refer back to 16. Dezember 2002 with zziplib version 0.10.66.
4 Most things refer to MSVC which have a different README
5 (and there are msvc project files being shipped along)
6 The rest is mainly an example program that you can use as a
7 boilerplate in your souce code - may be just copy and use.
9 ---------------------------------------------------------------------
10 16122002, Thomas.Eder@nmi.at, Using the zziplib library with SDL
16 zziplib 0.10.66 (preview), SDL 1.2.5, Win32, MSVC6
19 zziplib.sourceforge.net (zziplib-0.10.66.tar.gz)
20 www.libsdl.org (SDL-devel-1.2.5a-VC6.zip)
22 Also you have to get zlib, I used
23 from SDL_image-1.2.2.zip in VisualC.zip:
24 zlib.lib (12.7.1998, 34674 bytes)
25 zlib.h ( 9.7.1998, 41791 bytes, 1.1.3)
26 zconf.h ( 8.7.1998, 8089 bytes)
28 from SDL_image-devel-1.2.2-VC6.zip:
29 zlib.dll ( 5.4.2001, 53760 bytes, 1.1.3.1)
31 Maybe you should get the latest version (currently 1.1.4) from
32 http://gnuwin32.sourceforge.net/install.html
33 (see notes at end of page!)
36 CREATING zzlib.dll/zzlib.lib
38 Copy your versions of zlib.lib, zlib.h and zconf.h to the zzlib
40 In MSVC (start zziplib.dsw)
41 Add zlib.lib to the files for the zziplib_DLL project.
42 Add ZLIB_DLL to the preprocessor definitions.
44 Set the active project and the active configuration to create zziplib.dll
45 and zziplib.lib (I created and used the release version).
50 Include/add the following files to your SDL-Project
51 (put them in proper directories, etc.):
71 you may also want to use
76 For compiling it should be sufficient to use
78 in the files where you use zziplib-functions.
83 It is possible to use both original (unzipped) and zipped versions of files,
84 and zziplib will take one of them (depending on the modes when calling
87 But this didnt work for all of my original files, so I suggest using zipped
88 files only (and remove the original unzipped files, so zziplib doesnt try to
89 open the original version).
94 When opening many files from a zip, its faster to open the zip-directory
95 only once, and not for every file access. You may want to modify
96 SDL_rwops_zzip for this to get code like:
101 SDL_Surface* temp1 = NULL; //default > NULL > error
102 SDL_Surface* temp2 = NULL; //default > NULL > error
104 //last param may be used for err return
105 ZZIP_DIR* zzipdir = zzip_dir_open( "figures.zip", NULL );
107 ZZIP_FILE* zfile = zzip_file_open(zzipdir, "f1.bmp", ZZIP_CASELESS);
111 rw = SDL_RWFromZZIP(zfile); //modified version
114 temp1 = IMG_Load_RW(rw, 0);
117 int zret = zzip_file_close( zfile );
120 zfile = zzip_file_open(zzipdir, "f2.bmp", ZZIP_CASELESS);
123 rw = SDL_RWFromZZIP(zfile); //modified version
126 temp2 = IMG_Load_RW(rw, 0);
129 int zret = zzip_file_close( zfile );
134 zzip_dir_close( zzipdir );