浏览代码

Terrain: Disable image watch for terrain tiles

trethaller 6 年之前
父节点
当前提交
77b2803e37
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      hrt/prefab/terrain/Terrain.hx

+ 3 - 0
hrt/prefab/terrain/Terrain.hx

@@ -105,6 +105,8 @@ class Terrain extends Object3D {
 	}
 	}
 
 
 	function loadTiles( ctx : Context, height = true, index = true , weight = true ) {
 	function loadTiles( ctx : Context, height = true, index = true , weight = true ) {
+		var prevWatch = @:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH;
+		@:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH = false;
 		var resDir = ctx.shared.loadDir(name);
 		var resDir = ctx.shared.loadDir(name);
 		if( resDir == null ) return;
 		if( resDir == null ) return;
 		for( res in resDir ) {
 		for( res in resDir ) {
@@ -152,6 +154,7 @@ class Terrain extends Object3D {
 				}
 				}
 			}
 			}
 		}
 		}
+		@:privateAccess hxd.res.Image.ENABLE_AUTO_WATCH = prevWatch;
 	}
 	}
 
 
 	function loadSurfaces( ctx : Context, onEnd : Void -> Void ) {
 	function loadSurfaces( ctx : Context, onEnd : Void -> Void ) {