Explorar o código

allow to disable async

ncannasse %!s(int64=8) %!d(string=hai) anos
pai
achega
6fc23416a9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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) {