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).
Avoid saving of dynamically computed content
Moderator: Moderators
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 disagreeKjell 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 ..

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);