Skip to content

Commit

Permalink
Wrap bitmaps for debugger with FLX_DEBUG so they don't appear in rele…
Browse files Browse the repository at this point in the history
…ase build
  • Loading branch information
T1mL3arn committed Jan 16, 2024
1 parent be22f5c commit 3a6eae8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions flixel/system/debug/FlxDebugger.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package flixel.system.debug;

#if FLX_DEBUG
import openfl.display.BitmapData;
import openfl.display.Sprite;
import openfl.events.MouseEvent;
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -520,8 +520,8 @@ class FlxDebugger extends Sprite
}
FlxG.openURL(url);
}
#end
}
#end

enum FlxDebuggerLayout
{
Expand All @@ -531,4 +531,4 @@ enum FlxDebuggerLayout
TOP;
LEFT;
RIGHT;
}
}
6 changes: 5 additions & 1 deletion flixel/system/debug/Window.hx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -454,3 +455,6 @@ class Window extends Sprite
#end
}
}
#else
class Window extends openfl.display.Sprite {}
#end
2 changes: 2 additions & 0 deletions flixel/system/debug/interaction/Interaction.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package flixel.system.debug.interaction;

#if FLX_DEBUG
import openfl.display.BitmapData;
import openfl.display.Graphics;
import openfl.display.Sprite;
Expand Down Expand Up @@ -743,3 +744,4 @@ class Interaction extends Window
return null;
}
}
#end
4 changes: 1 addition & 3 deletions flixel/system/debug/stats/Stats.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ private class GraphicMaximizeButton extends BitmapData {}
* @author Adam "Atomic" Saltsman
* @author Anton Karlov
*/
#if FLX_DEBUG
class Stats extends Window
{
/**
Expand Down Expand Up @@ -446,5 +445,4 @@ class Stats extends Window
_toggleSizeButton.y = 3;
}
}
}
#end
}
5 changes: 3 additions & 2 deletions flixel/system/debug/watch/Tracker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -264,8 +265,8 @@ class Tracker extends Watch
for (variable in Variables)
add(variable, FIELD(_object, variable));
}
#end
}
#end

class TrackerProfile
{
Expand Down
4 changes: 2 additions & 2 deletions flixel/system/debug/watch/Watch.hx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -161,5 +161,5 @@ class Watch extends Window
}
return max;
}
#end
}
#end

0 comments on commit 3a6eae8

Please sign in to comment.