Explorar o código

Removed every #if prefab2

Clement Espeute hai 1 ano
pai
achega
617dc2040f
Modificáronse 2 ficheiros con 0 adicións e 39 borrados
  1. 0 26
      h3d/prim/ModelCache.hx
  2. 0 13
      hxd/fmt/hmd/Library.hx

+ 0 - 26
h3d/prim/ModelCache.hx

@@ -170,7 +170,6 @@ class ModelCache {
 	#if hide
 
 	public function loadPrefab( res : hxd.res.Prefab, ?p : hrt.prefab.Prefab, ?parent : h3d.scene.Object ) {
-		#if prefab2
 		if( p == null )
 			p = res.load();
 		var prevChild = 0;
@@ -195,31 +194,6 @@ class ModelCache {
 				return obj;
 		}
 		return local3d;
-		#else
-		if( p == null )
-			p = res.load();
-		var ctx = new hrt.prefab.Context();
-		ctx.init(res);
-		@:privateAccess ctx.shared.cache = this;
-		var prevChild = 0;
-		if( parent != null ) {
-			ctx.local3d = ctx.shared.root3d = parent;
-			prevChild = parent.numChildren;
-		}
-		var ctx2 = p.make(ctx);
-		if( parent != null ) {
-			// only return object if a single child was added
-			// if not - multiple children were added and cannot be returned as a single object
-			return parent.numChildren == prevChild + 1 ? parent.getChildAt(prevChild) : null;
-		}
-		if( ctx.local3d.numChildren == 1 ) {
-			// if we have a single root with no scale/rotate/offset we can return it
-			var obj = ctx.local3d.getChildAt(0);
-			if( obj.getTransform().isIdentity() )
-				return obj;
-		}
-		return ctx.local3d;
-		#end
 	}
 
 	#end

+ 0 - 13
hxd/fmt/hmd/Library.hx

@@ -19,11 +19,7 @@ private class ContextShared extends hrt.prefab.ContextShared {
 	var customLoadTexture : String -> h3d.mat.Texture;
 
 	public function new(loadTexture : String -> h3d.mat.Texture, ?root3d: h3d.scene.Object = null) {
-		#if prefab2
 		super(root3d);
-		#else
-		super();
-		#end
 		this.customLoadTexture = loadTexture;
 	}
 
@@ -768,18 +764,9 @@ class Library {
 		if (materialContainer == null)
 			materialContainer = new h3d.scene.Mesh(null, mat, null);
 
-	#if prefab2
 		var shared = new ContextShared(loadTexture, materialContainer);
         materialContainer.material = mat;
         m.make(shared);
-	#else
-		var ctx = new hrt.prefab.Context();
-		ctx.shared = new ContextShared(loadTexture);
-
-		materialContainer.material = mat;
-		ctx.local3d = materialContainer;
-		m.make(ctx);
-	#end
         // Ensure there is no leak with this
 		materialContainer.material = null;