Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/UncertainProd/flixel into bm…
Browse files Browse the repository at this point in the history
…font-parsing
  • Loading branch information
UncertainProd committed Nov 8, 2023
2 parents 02f8c4f + 38762cb commit 2df42f6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions flixel/ui/FlxBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class FlxBar extends FlxSprite
var _fillHorizontal:Bool;

/**
* FlxSprite which is used for rendering front graphics of bar (showing value) in tile render mode.
* FlxFrame which is used for rendering front graphics of bar (showing value) in tile render mode.
*/
var _frontFrame:FlxFrame;

Expand Down Expand Up @@ -198,9 +198,9 @@ class FlxBar extends FlxSprite
{
positionOffset = FlxDestroyUtil.put(positionOffset);

if (FlxG.renderBlit)
if (FlxG.renderTile)
{
_frontFrame = null;
frontFrames = null;
_filledFlxRect = FlxDestroyUtil.put(_filledFlxRect);
}
else
Expand All @@ -214,7 +214,6 @@ class FlxBar extends FlxSprite
_filledBarPoint = null;

parent = null;
positionOffset = null;
emptyCallback = null;
filledCallback = null;

Expand Down Expand Up @@ -984,8 +983,14 @@ class FlxBar extends FlxSprite
{
if (FlxG.renderTile)
{
if (value != null)
value.parent.incrementUseCount();

if (frontFrames != null)
frontFrames.parent.decrementUseCount();

frontFrames = value;
_frontFrame = (value != null) ? value.frame.copyTo(_frontFrame) : null;
_frontFrame = (value != null) ? value.frame.copyTo(_frontFrame) : FlxDestroyUtil.destroy(_frontFrame);
}
else
{
Expand Down

0 comments on commit 2df42f6

Please sign in to comment.