Active Forums => QB64 Discussion => Topic started by: Cobalt on December 08, 2021, 04:23:35 pm
Title: A question about _INFLATE$\_DEFLATE$ usage
Post by: Cobalt on December 08, 2021, 04:23:35 pm
I was looking into using these commands for my World Builder program to help with the saved map size issue it is facing now. Recent changes, things I just did last night and today, have ballooned the file size to several megs.
Looking at the WIKI the commands take string values. Now my map data is made up of UDTs and integer arrays. How would I go about using these commands to compress the map size when saved?
Title: Re: A question about _INFLATE$\_DEFLATE$ usage
Post by: SpriggsySpriggs on December 08, 2021, 04:27:39 pm
I would make a MEM block and then store all of your map data in it. Then, make a string equal to the size of the memory block. Get the contents of the memory block using MEMGET and store it in the string. Use DEFLATE$ on the string. Now you've compressed the raw map data and can store it elsewhere. Basically use INFLATE$ and reverse the process to unpack.
Title: Re: A question about _INFLATE$\_DEFLATE$ usage
Post by: SMcNeill on December 08, 2021, 06:02:10 pm