Page 1 of 1

Avoid saving of dynamically computed content

Posted: Mon Sep 08, 2014 12:05 pm
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).

Posted: Mon Sep 15, 2014 1:31 pm
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?

Posted: Mon Sep 15, 2014 2:27 pm
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

Posted: Mon Sep 15, 2014 5:35 pm
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.