فهرست منبع

allow to disable async

ncannasse 8 سال پیش
والد
کامیت
6fc23416a9
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      h3d/mat/TextureChannels.hx

+ 2 - 1
h3d/mat/TextureChannels.hx

@@ -4,6 +4,7 @@ import h3d.mat.Data;
 class TextureChannels extends Texture {
 
 	var pixels : hxd.Pixels;
+	public var allowAsync : Bool = true;
 
 	public function new(w, h, ?flags : Array<TextureFlags>, ?format : TextureFormat, ?allocPos : h3d.impl.AllocPos ) {
 		if( flags == null ) flags = [];
@@ -43,7 +44,7 @@ class TextureChannels extends Texture {
 
 	public function setResource( c : hxd.Pixels.Channel, res : hxd.res.Image, ?srcChannel : hxd.Pixels.Channel ) {
 		if( srcChannel == null ) srcChannel = c;
-		if( !res.getFormat().useAsyncDecode )
+		if( !allowAsync || !res.getFormat().useAsyncDecode )
 			setPixels(c, res.getPixels(), srcChannel);
 		else {
 			res.entry.loadBitmap(function(bmp) {