Skip to content

Commit c5be7de

Browse files
committed
Revert Asset and Source to their original types, use FlxAssets.resolveBitmapData instead.
1 parent 4c54bec commit c5be7de

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

flixel/system/FlxAssets.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ class VirtualInputData extends #if nme ByteArray #else ByteArrayData #end {}
3636
typedef FlxTexturePackerJsonAsset = FlxJsonAsset<TexturePackerAtlas>;
3737
typedef FlxAsepriteJsonAsset = FlxJsonAsset<AseAtlas>;
3838
typedef FlxSoundAsset = OneOfThree<String, Sound, Class<Sound>>;
39+
typedef FlxGraphicAsset = OneOfFour<FlxGraphic, BitmapData, String, Class<Dynamic>>;
3940
typedef FlxTilemapGraphicAsset = OneOfFour<FlxFramesCollection, FlxGraphic, BitmapData, String>;
4041
typedef FlxBitmapFontGraphicAsset = OneOfFour<FlxFrame, FlxGraphic, BitmapData, String>;
4142

42-
abstract FlxGraphicAsset(OneOfFour<FlxGraphic, BitmapData, String, Class<Dynamic>>) from FlxGraphic from BitmapData from Class<Dynamic> from String
43+
@:deprecated("`FlxGraphicSource` is deprecated, use `FlxGraphicAsset` instead")
44+
abstract FlxGraphicSource(FlxGraphicAsset) from FlxGraphic from BitmapData from Class<Dynamic> from String
4345
{
46+
@:deprecated("`resolveBitmapData` is deprecated, use `FlxAssets.resolveBitmapData` instead")
4447
public inline function resolveBitmapData():BitmapData
4548
{
4649
return FlxAssets.resolveBitmapData(cast this);
4750
}
4851
}
4952

50-
@:deprecated("`FlxGraphicSource` is deprecated, use `FlxGraphicAsset` instead")
51-
typedef FlxGraphicSource = FlxGraphicAsset;
52-
5353
abstract FlxAngelCodeAsset(OneOfThree<Xml, String, Bytes>) from Xml from String from Bytes
5454
{
5555
public inline function parse()

flixel/system/debug/FlxDebugger.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ class FlxDebugger extends openfl.display.Sprite
417417

418418
public function addWindowToggleButton(window:Window, icon:FlxGraphicAsset):Void
419419
{
420-
var button = addButton(RIGHT, icon.resolveBitmapData(), window.toggleVisible, true, true);
420+
var button = addButton(RIGHT, FlxAssets.resolveBitmapData(icon), window.toggleVisible, true, true);
421421
window.toggleButton = button;
422422
button.toggled = !window.visible;
423423
}

flixel/system/debug/interaction/tools/Tool.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Tool extends Sprite implements IFlxDestroyable
4545

4646
function setButton(icon:FlxGraphicAsset):Void
4747
{
48-
button = new FlxSystemButton(icon.resolveBitmapData(), onButtonClicked, true);
48+
button = new FlxSystemButton(FlxAssets.resolveBitmapData(icon), onButtonClicked, true);
4949
button.toggled = true;
5050

5151
var tooltipName = _name;

flixel/util/FlxStringUtil.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ class FlxStringUtil
564564
*/
565565
public static function imageToCSV(graphic:FlxGraphicAsset, invert = false, scale = 1, ?colorMap:Array<FlxColor>):String
566566
{
567-
return bitmapToCSV(graphic.resolveBitmapData(), invert, scale, colorMap);
567+
return bitmapToCSV(FlxAssets.resolveBitmapData(graphic), invert, scale, colorMap);
568568
}
569569

570570
/**

0 commit comments

Comments
 (0)