Selaa lähdekoodia

added USE_PNG_NATIVE_DECODE on flash

ncannasse 8 vuotta sitten
vanhempi
commit
c63e3caff6
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      hxd/res/Image.hx

+ 6 - 0
hxd/res/Image.hx

@@ -6,6 +6,10 @@ package hxd.res;
 	var Png = 1;
 	var Gif = 2;
 
+	#if flash
+	static var USE_PNG_NATIVE_DECODE = false;
+	#end
+
 	/*
 		Tells if we might not be able to directly decode the image without going through a loadBitmap async call.
 		This for example occurs when we want to decode progressive JPG in JS.
@@ -15,6 +19,8 @@ package hxd.res;
 	inline function get_useAsyncDecode() {
 		#if hl
 		return false;
+		#elseif flash
+		return this == Jpg.toInt() || (USE_PNG_NATIVE_DECODE && this == Png.toInt());
 		#else
 		return this == Jpg.toInt();
 		#end