Wrap bitmaps for debugger with FLX_DEBUG so they don't appear in release build
There are some bitmaps which are used only when FLX_DEBUG implies but aren't wrapped with this define. So they are included in release build inflating project size and aren't used by any code
If such behavior is considered a bug I will wrap other similar cases.
My assumption is that these classes are only included if referenced in code, as they don't have the @:keep tag like other graphics do, therefore these already do not appear in release builds
as they don't have the @:keep tag
I believe the problem is with @:bitmap - it embeds data no matter what.
See these html5 builds:
The first one is default release compilation, search GraphicMinimizeButton and you will see it is there.
https://github.com/T1mL3arn/HaxeFlixel-Pong/commit/04dcf39ecfa502a021ee3be50439c37cee56babf
This one I made just now, with excluded bitmaps. Search GraphicMinimizeButton and there are only deletions.
https://github.com/T1mL3arn/HaxeFlixel-Pong/commit/c827ffe1328124ce5c230ff82d42f954e1eb250d
CI is failing because of the changes you made to the new classes, i dont see why you edited those classes
CI is failing because of the changes you made to the new classes
Can you elaborate more why checks are failing? I see in log that it failed on HaxeFlixel/setup-flixel@v1 but it doesn't provide any details what's wrong and I also see that tests, demos, and snippets are all green. I am confused.
i dont see why you edited those classes
It's not possible to just wrap bitmap classes as they are - projects won't compile. So I had to figure out some minimum of changes that allows compilation in both debug and release modes.
Other ways to consider:
- wrap debug things on the very top of
FlxG, so none of them are available in release builds (e.g. users must then wrapFlxG.debuggerin their code) - wrap each
@:bitmapbut not the types themselves, so bitmaps are not included and types are erased if user doesdceoranalyzer - ask Haxe to fix
@:bitmap
Type not found: StatsGraph
Also i thought @:bitmap was a openfl/lime thing
this was the change I originally requested. Not sure why you changed any of the other files, as those are outside the scope and also breaking changes.
this should prevent the images from being embedded in release, please verify this
Sorry for late response.
Not sure why you changed any of the other file
To make it compile. This problem with embedded bitmaps goes beyond a module from the initial commit - there are quite enough such bitmaps.
Are there any issues with these new changes? Can you verify that this prevents them from being embedded?
@T1mL3arn ?
Can you verify that this prevents them from being embedded?
Fixed via https://github.com/HaxeFlixel/flixel/pull/3077 I went a simpler route