PDA

View Full Version : zLib - archives



ReneMiner
11-12-2015, 12:01
perhaps it could be possible to put needed resources for a script (as media\, fonts\ etc.) into a *.zip-file and unzip the needed files during runtime directly to memory.
(in Purebasic users can do nearly that).

Like


Uses "zLib"

#Include Archive "media.zip" ' (located obviously to app_scriptpath)

String myBMPData = zLib_Load( { ["media.zip",] "greenButton.bmp" | "media\greenButton.bmp" } )


...?


later include the zip-archive to


#Bundle Archive "media.zip" ...

ErosOlmi
12-12-2015, 04:56
Thanks, great idea.

I've developed a new zLib function able to extract a file from a ZIP file and return it into a string buffer:


string sBuffer = ZLib_ExtractToString(ZIPFileName, FileNameToExtract)


Will be present in next release.

Ciao
Eros

ReneMiner
13-12-2015, 20:25
Very nice, i guess it will become handy :)