فهرست منبع

[TEXTURE][ASYNC] Minor fix on async loading.

clandrin 3 سال پیش
والد
کامیت
30c2d5cc46
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      hxd/res/Image.hx

+ 2 - 0
hxd/res/Image.hx

@@ -485,6 +485,7 @@ class Image extends Resource {
 		if( !getFormat().useAsyncDecode && !DEFAULT_ASYNC ) {
 			function load() {
 				if( tex.flags.has(AsyncLoading) && asyncData == null && ASYNC_LOADER.isSupported(this) ) @:privateAccess {
+					tex.dispose();
 					tex.format = RGBA;
 					tex.width = 1;
 					tex.height = 1;
@@ -494,6 +495,7 @@ class Image extends Resource {
 					tex.width = inf.width;
 					tex.height = inf.height;
 					ASYNC_LOADER.load(this);
+					tex.realloc = () -> loadTexture();
 					return;
 				}
 				var t0 = haxe.Timer.stamp();