I’m making my game much more moddable, and it’d be great if users could drag and drop a zipped folder full of modded things into my game and have it unzip that folder.
Does SDL have anything built-in that can unzip? Or is there an easy 3rd party way of doing this?
There’s no built-ins for this, but you can use Zipper (MIT Licensed) it’s a minizip wrapper with nice C++ api, zziplib (GNU GPL v2 license) C api, miniz (MIT License ) C api, or maybe the minizip itself.
Also be aware of ZipSlip vulnerability when working with arbitrary ZIP files.
I think PhysFS can let you access the things inside the zip without unzipping it quite transparently.
Nothing built-in, but PhysicsFS by @icculus more or less aims to recreate the way you could mod id Software games by dropping a .WAD/.PAK/.PK3 file into the right directory and it’d override the game files.
edit: @eri0o yeah, PhysFS lets you read the contents of the .zip files without actually unzipping them.