Browse Source

minor fixes

Nicolas Cannasse 7 years ago
parent
commit
3db028e850
2 changed files with 8 additions and 2 deletions
  1. 1 1
      hide/comp/Scene.hx
  2. 7 1
      hide/ui/Ide.hx

+ 1 - 1
hide/comp/Scene.hx

@@ -366,7 +366,7 @@ class Scene extends Component implements h3d.IDrawable {
 			}
 			hmd = hxd.res.Any.fromBytes(path, data).toModel().toHmd();
 		} else {
-			hmd = e.toHmd();
+			hmd = e.toModel().toHmd();
 		}
 
 		hmdCache.set(key, hmd);

+ 7 - 1
hide/ui/Ide.hx

@@ -549,7 +549,13 @@ class CustomLoader extends hxd.res.Loader {
 		return k;
 	}
 
-	override function loadImage( path : String ) {
+	override function loadCache<T:hxd.res.Resource>( path : String, c : Class<T> ) : T {
+		if( (c:Dynamic) == (hxd.res.Image:Dynamic) )
+			return cast loadImage(path);
+		return super.loadCache(path, c);
+	}
+
+	function loadImage( path : String ) {
 		var engine = h3d.Engine.getCurrent();
 		var i : hxd.res.Image = @:privateAccess engine.resCache.get(getKey(path));
 		if( i == null ) {