File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -633,6 +633,10 @@ class FlxGraphic implements IFlxDestroyable
633633 FlxG .log .warn (' Graphic dimensions ( ${width }x ${height }) exceed the maximum allowed size ( ${max }x ${max }), which may cause rendering issues.' );
634634 }
635635 #end
636+
637+ #if FLX_FREE_IMAGE_BUFFER
638+ freeImageBuffer ();
639+ #end
636640 }
637641
638642 return value ;
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ private enum UserDefines
5858 * If this flag is set to any string, that is used for the file extension
5959 */
6060 FLX_DEFAULT_SOUND_EXT ;
61+ /**
62+ * If enabled, FlxGraphic instances will automatically call `FlxGraphic.freeImageBuffer()`.
63+ * This significantly decreases RAM usage but makes the bitmap uneditable.
64+ * Call `FlxGraphic.refresh()` to restore functionality for drawing on the bitmap.
65+ */
66+ FLX_FREE_IMAGE_BUFFER ;
6167}
6268
6369/**
You can’t perform that action at this time.
0 commit comments