SDL_zipfile 0.1.0

This is just a small zipfile library I put together that uses libz and SDL. This library can load directories in a zipfile (recursively or non-recursively) into memory, and if the filetype is known (determined by extension), it will automatically convert it into a ready-to-use format. For instance, if a zipfile contained bitmaps, it would load them and then you could just use the data returned to blit it straight to a surface. Currently the drivers implemented are text, bitmaps, and sound. I tried to do music, but SDL_mixer does not have the RWops implemented for the music formats yet, so the code is disabled by default. There’s also a zip2h file utility that converts what’s in a zipfile to a header file so you can use predefined macros to access data.

I’m sure there’s plenty of small projects that do something similar, but I found nothing and wanted something similar to the Allegro datafile lib. Feedback is appreciated, as is bugs or feature requests.

Oh and BTW if you want to contact me use @Ben_Stover because I’m not subscribed to the mailing list.

http://sdlzipfile.sourceforge.net/

~Benjamin Stover_______________________________________________
SDL-announce mailing list
SDL-announce at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl-announce

Sorry to mention this, but there’s already something that does this quite well:
http://www.icculus.org/physfs/On Wed, 2003-01-01 at 14:01, Ben Stover wrote:

This is just a small zipfile library I put together that uses libz and SDL. This library can load directories in a zipfile (recursively or non-recursively) into memory, and if the filetype is known (determined by extension), it will automatically convert it into a ready-to-use format. For instance, if a zipfile contained bitmaps, it would load them and then you could just use the data returned to blit it straight to a surface. Currently the drivers implemented are text, bitmaps, and sound. I tried to do music, but SDL_mixer does not have the RWops implemented for the music formats yet, so the code is disabled by default. There’s also a zip2h file utility that converts what’s in a zipfile to a header file so you can use predefined macros to access data.

I’m sure there’s plenty of small projects that do something similar, but I found nothing and wanted something similar to the Allegro datafile lib. Feedback is appreciated, as is bugs or feature requests.

Oh and BTW if you want to contact me use bstover at ossm.edu because I’m not subscribed to the mailing list.

http://sdlzipfile.sourceforge.net/

Shawn wrote:> On Wed, 2003-01-01 at 14:01, Ben Stover wrote:

This is just a small zipfile library I put together that uses libz and SDL. This library can load directories in a zipfile (recursively or non-recursively) into memory, and if the filetype is known (determined by extension), it will automatically convert it into a ready-to-use format. For instance, if a zipfile contained bitmaps, it would load them and then you could just use the data returned to blit it straight to a surface. Currently the drivers implemented are text, bitmaps, and sound. I tried to do music, but SDL_mixer does not have the RWops implemented for the music formats yet, so the code is disabled by default. There’s also a zip2h file utility that converts what’s in a zipfile to a header file so you can use predefined macros to access data.

I’m sure there’s plenty of small projects that do something similar, but I found nothing and wanted something similar to the Allegro datafile lib. Feedback is appreciated, as is bugs or feature requests.

Oh and BTW if you want to contact me use bstover at ossm.edu because I’m not subscribed to the mailing list.

http://sdlzipfile.sourceforge.net/

Sorry to mention this, but there’s already something that does this quite well:
http://www.icculus.org/physfs/

and what about http://zziplib.sf.net ??

btw, why did you viralize it with the GPL - more than 2/3rd of your lib are based
on code under the zlib license - this is not generally consired nice, ye know.

I just happened to be browsing the SDL mailing list archives and saw these two responses. I apologize for not replying earlier, and I can’t seem to set my reply-to in my e-mail client (blasted web Groupwise).

Sorry to mention this, but there’s already something that does this quite well:
http://www.icculus.org/physfs/

and what about http://zziplib.sf.net ??

Just from a brief look at the libraries, they aren’t quite the same as my little piece of code if I read correctly. It seems that they create a whole virtual hierarchy to play with, and mine has a much smaller scope. My code simply reads a zipfile, loads the data into memory, and if it knows what it is (bitmap, sound, etc) then it converts the file data into something that is ready to be used (ie blit to the screen, played, etc). I wanted something that worked like the Allegro datafiles, so I came up with this small (but satisfactory to me) solution.

btw, why did you viralize it with the GPL - more than 2/3rd of your lib are based
on code under the zlib license - this is not generally consired nice, ye know.

Sorry, I didn’t mean any offense by it. :frowning: I really wasn’t thinking about the whole licensing thing, and just to clarify, I didn’t try to take the zlib license and throw it out the window. All the source code I borrowed has its own copyright at the top which would override my GPL. But I have no objections to making it LGPL, I just simply didn’t expect that sort of thing to be an issue. :slight_smile: Thanks for the replies!

~Ben