From 3a6eae84eba8eae1878a9f93788658d3ece83e2c Mon Sep 17 00:00:00 2001 From: T1mL3arn Date: Tue, 16 Jan 2024 20:42:43 +1000 Subject: [PATCH] Wrap bitmaps for debugger with FLX_DEBUG so they don't appear in release build --- flixel/system/debug/FlxDebugger.hx | 6 +++--- flixel/system/debug/Window.hx | 6 +++++- flixel/system/debug/interaction/Interaction.hx | 2 ++ flixel/system/debug/stats/Stats.hx | 4 +--- flixel/system/debug/watch/Tracker.hx | 5 +++-- flixel/system/debug/watch/Watch.hx | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/flixel/system/debug/FlxDebugger.hx b/flixel/system/debug/FlxDebugger.hx index 7e81462ce4..255b8d401a 100644 --- a/flixel/system/debug/FlxDebugger.hx +++ b/flixel/system/debug/FlxDebugger.hx @@ -1,5 +1,6 @@ package flixel.system.debug; +#if FLX_DEBUG import openfl.display.BitmapData; import openfl.display.Sprite; import openfl.events.MouseEvent; @@ -63,7 +64,6 @@ private class GraphicDrawDebug extends BitmapData {} */ class FlxDebugger extends Sprite { - #if FLX_DEBUG /** * Internal, used to space out windows from the edges. */ @@ -520,8 +520,8 @@ class FlxDebugger extends Sprite } FlxG.openURL(url); } - #end } +#end enum FlxDebuggerLayout { @@ -531,4 +531,4 @@ enum FlxDebuggerLayout TOP; LEFT; RIGHT; -} +} \ No newline at end of file diff --git a/flixel/system/debug/Window.hx b/flixel/system/debug/Window.hx index 5ef52b333c..b360e97c95 100644 --- a/flixel/system/debug/Window.hx +++ b/flixel/system/debug/Window.hx @@ -1,8 +1,9 @@ package flixel.system.debug; +#if FLX_DEBUG +import openfl.display.Sprite; import openfl.display.Bitmap; import openfl.display.BitmapData; -import openfl.display.Sprite; import openfl.events.Event; import openfl.events.MouseEvent; import openfl.geom.Point; @@ -454,3 +455,6 @@ class Window extends Sprite #end } } +#else +class Window extends openfl.display.Sprite {} +#end \ No newline at end of file diff --git a/flixel/system/debug/interaction/Interaction.hx b/flixel/system/debug/interaction/Interaction.hx index 7f5de15140..98b1f1faf9 100644 --- a/flixel/system/debug/interaction/Interaction.hx +++ b/flixel/system/debug/interaction/Interaction.hx @@ -1,5 +1,6 @@ package flixel.system.debug.interaction; +#if FLX_DEBUG import openfl.display.BitmapData; import openfl.display.Graphics; import openfl.display.Sprite; @@ -743,3 +744,4 @@ class Interaction extends Window return null; } } +#end \ No newline at end of file diff --git a/flixel/system/debug/stats/Stats.hx b/flixel/system/debug/stats/Stats.hx index d54e9071ce..f0330706f6 100644 --- a/flixel/system/debug/stats/Stats.hx +++ b/flixel/system/debug/stats/Stats.hx @@ -26,7 +26,6 @@ private class GraphicMaximizeButton extends BitmapData {} * @author Adam "Atomic" Saltsman * @author Anton Karlov */ -#if FLX_DEBUG class Stats extends Window { /** @@ -446,5 +445,4 @@ class Stats extends Window _toggleSizeButton.y = 3; } } -} -#end +} \ No newline at end of file diff --git a/flixel/system/debug/watch/Tracker.hx b/flixel/system/debug/watch/Tracker.hx index 29c86db1e5..14f43b1b1c 100644 --- a/flixel/system/debug/watch/Tracker.hx +++ b/flixel/system/debug/watch/Tracker.hx @@ -31,11 +31,12 @@ import flixel.animation.FlxAnimationController; import flixel.input.touch.FlxTouch; #end #end + import flixel.util.FlxStringUtil; +#if FLX_DEBUG class Tracker extends Watch { - #if FLX_DEBUG /** * Order matters here, as the last profile is the most relevant - i.e., if the * FlxSprite profile were added before the one for FlxObject, it would never be selected. @@ -264,8 +265,8 @@ class Tracker extends Watch for (variable in Variables) add(variable, FIELD(_object, variable)); } - #end } +#end class TrackerProfile { diff --git a/flixel/system/debug/watch/Watch.hx b/flixel/system/debug/watch/Watch.hx index ff50592790..53955bf674 100644 --- a/flixel/system/debug/watch/Watch.hx +++ b/flixel/system/debug/watch/Watch.hx @@ -1,5 +1,6 @@ package flixel.system.debug.watch; +#if FLX_DEBUG import flixel.FlxG; import flixel.math.FlxPoint; import flixel.system.debug.FlxDebugger.GraphicWatch; @@ -14,7 +15,6 @@ using flixel.util.FlxArrayUtil; */ class Watch extends Window { - #if FLX_DEBUG static inline var LINE_HEIGHT:Int = 15; var entriesContainer:Sprite; @@ -161,5 +161,5 @@ class Watch extends Window } return max; } - #end } +#end \ No newline at end of file