About Monkey 2 › Forums › Monkey 2 Programming Help › Status of miniz
This topic contains 5 replies, has 2 voices, and was last updated by 
 peterigz
 2 years, 4 months ago.
- 
		AuthorPosts
 - 
		
			
				
July 24, 2016 at 11:46 am #2388
Quick question: Is miniz in a usable state? I’m guessing no as there’s no docs and it looks wip but thought I’d check.
December 11, 2016 at 5:44 pm #5712Any ETA on miniz? Pretty much all I need now to finish off TimelineFX in monkey2 and add it to the list of modules.
December 11, 2016 at 7:54 pm #5713What do you need it for exactly?
It’s all ‘there’ in that the whole thing compiles, but the API side is incomplete and even if I complete it it wont be particularly easy to use as it’ll be very C-ish.
If you can give me some pointers re: what to concentrate on ‘mkaing useful’ first etc it’d help.
I do actually use it in the module manager to decompress files, so it already sort of works…
December 11, 2016 at 8:31 pm #5716I basically need it to load images and an xml file from a zip file. I seem to recall that currently loadimage only takes a string for the filename, whereas in Blitzmax it took an object which could be a stream, ie from a zip, so not sure if that’s possible yet.
And this is the code in Blitzmax that got the xml string from the zip, so something that can replicate this would be great.
Monkey12345678910Local zip:ZipReader = New ZipReaderzip.OpenZip(filename)Local xmlstream:TStream = zip.ExtractFile("DATA.XML")If Not xmlstream Throw "Error loading effects file!"Local xmlstring:Stringxmlstring = xmlstream.ReadString(xmlstream.Size())December 11, 2016 at 9:16 pm #5719so not sure if that’s possible yet.
No, no yet.
However, there’s already a std.zipfile.ZipFile class (used by module manager) that could be tweaked to perform simple file extraction, eg:
Monkey123456789Class ZipFileMethod Extract:DataBuffer( file:String )...doesn't exist yet!...Function Open:ZipFile( path:String )EndLocal zip:=ZipFile.Open( "Somefile.zip" )Local str:=zip.Extract( "DATA.XML" ).PeekString( 0 )Would this be enough for now?
December 11, 2016 at 11:39 pm #5729Ok, I think what I’ll for now is just import the folder (didn’t realise you could do this!), so similar to what I did in Monkey 1. So rather than load the zip you just extract the zip to a folder and #import “folder/” to reference everything that way. Loading it all straight from the zip would be the most ideal solution (without having to extract anything to disk), but not an emergency.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.