@@ -36,17 +36,20 @@ class VirtualInputData extends #if nme ByteArray #else ByteArrayData #end {}
3636typedef FlxTexturePackerJsonAsset = FlxJsonAsset <TexturePackerAtlas >;
3737typedef FlxAsepriteJsonAsset = FlxJsonAsset <AseAtlas >;
3838typedef FlxSoundAsset = OneOfThree <String , Sound , Class <Sound >>;
39- typedef FlxGraphicAsset = OneOfThree <FlxGraphic , BitmapData , String >;
4039typedef FlxTilemapGraphicAsset = OneOfFour <FlxFramesCollection , FlxGraphic , BitmapData , String >;
4140typedef FlxBitmapFontGraphicAsset = OneOfFour <FlxFrame , FlxGraphic , BitmapData , String >;
42- abstract FlxGraphicSource (OneOfThree <BitmapData , Class <Dynamic >, String >) from BitmapData from Class <Dynamic > from String
41+
42+ abstract FlxGraphicAsset (OneOfFour <FlxGraphic , BitmapData , String , Class <Dynamic >>) from FlxGraphic to FlxGraphic from BitmapData to BitmapData from String to String from Class <Dynamic > to Class <Dynamic >
4343{
44- public function resolveBitmapData ()
44+ public inline function resolveBitmapData (): BitmapData
4545 {
4646 return FlxAssets .resolveBitmapData (cast this );
4747 }
4848}
4949
50+ @:deprecated (" `FlxGraphicSource` is deprecated, use `FlxGraphicAsset` instead" )
51+ typedef FlxGraphicSource = FlxGraphicAsset ;
52+
5053abstract FlxAngelCodeAsset (OneOfThree <Xml , String , Bytes >) from Xml from String from Bytes
5154{
5255 public inline function parse ()
@@ -55,7 +58,6 @@ abstract FlxAngelCodeAsset(OneOfThree<Xml, String, Bytes>) from Xml from String
5558 }
5659}
5760
58-
5961@:deprecated (" `FlxAngelCodeXmlAsset` is deprecated, use `FlxAngelCodeAsset` instead" )// 5.6.0
6062typedef FlxAngelCodeXmlAsset = FlxAngelCodeAsset ;
6163
@@ -304,8 +306,12 @@ class FlxAssets
304306 * @param graphic input data to get BitmapData object for.
305307 * @return BitmapData for specified Dynamic object.
306308 */
307- public static function resolveBitmapData (graphic : FlxGraphicSource ): BitmapData
309+ public static function resolveBitmapData (graphic : FlxGraphicAsset ): BitmapData
308310 {
311+ if ((graphic is FlxGraphic ))
312+ {
313+ return cast (graphic , FlxGraphic ).bitmap ;
314+ }
309315 if ((graphic is BitmapData ))
310316 {
311317 return cast graphic ;
@@ -333,12 +339,16 @@ class FlxAssets
333339 * @param key optional key string.
334340 * @return Key String for specified Graphic object.
335341 */
336- public static function resolveKey (graphic : FlxGraphicSource , ? key : String ): String
342+ public static function resolveKey (graphic : FlxGraphicAsset , ? key : String ): String
337343 {
338344 if (key != null )
339345 return key ;
340346
341- if ((graphic is BitmapData ))
347+ if ((graphic is FlxGraphic ))
348+ {
349+ return cast (graphic , FlxGraphic ).key ;
350+ }
351+ else if ((graphic is BitmapData ))
342352 {
343353 return key ;
344354 }
0 commit comments