Avoid saving of dynamically computed content

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Avoid saving of dynamically computed content

Post by Rado1 »

Current situation: Even if the content of some components, e.g., bitmaps, sample imports or arrays is always dynamically computed or obtained from files in runtime, ZGE project contains their last content and saves the project file and the generated exe/apk together with that content. This makes the project files and generated exe/apk unnecessary large. One solution would be to clear the content each time on OnClose, but this is very cumbersome since ZGE does not contain direct functions or properties to set the content of SampleImport, Bitmap, etc.

Solution: Add a boolean property (call it e.g. Dynamic) to these components and if set (to true) on a component, its content is not saved to .zgeproj or to generated exe/apk files. By default, the property should be unset (false).
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi folks. Any opinion about this feature? I see quite important to reduce the size of zgeproj files and generated exe and apk files. Ville, is there any chance to have it implemented?
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hmm,

I'd prefer ( for example ) "setBinaryProp(MyBitmap.BitmapFile, null);" or "clearBinaryProp(MyBitmap.BitmapFile);" to clear the binary data associated with such components instead of introducing a checkbox for such purpose ..

But feel free to disagree :wink:

K
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Kjell wrote:I'd prefer ( for example ) "setBinaryProp(MyBitmap.BitmapFile, null);" or "clearBinaryProp(MyBitmap.BitmapFile);" to clear the binary data associated with such components instead of introducing a checkbox for such purpose ..
Yes, this also would be possible, but it would require to run the application and put such a function call to OnClose or OnLeave sections. In contrary to this approach, the Dynamic checkbox would be applied only when saving the project or generating exe or apk. This seems to be simpler for me. But feel free to disagree :wink:

Anyway, setBinaryProp(MusicSample.SampleData, null) throws an access violation error now. What is possible is to set the content to an empty array, e.g.:

Code: Select all

MusicFileBuffer.SizeDim1 = 0;
setBinaryProp(ImportMusicSample.SampleData, MusicFileBuffer);
I do not see this as an ideal solution.
Post Reply