Browse Source

Fix build

ShiroSmith 6 years ago
parent
commit
64bbed5546
2 changed files with 10 additions and 15 deletions
  1. 2 2
      h2d/RenderContext.hx
  2. 8 13
      h3d/scene/pbr/SpotLight.hx

+ 2 - 2
h2d/RenderContext.hx

@@ -68,8 +68,8 @@ class RenderContext extends h3d.impl.RenderContext {
 		filterStack = [];
 	}
 
-	public function dispose() {
-		textures.dispose();
+	override function dispose() {
+		super.dispose();
 		if( fixedBuffer != null ) fixedBuffer.dispose();
 	}
 

+ 8 - 13
h3d/scene/pbr/SpotLight.hx

@@ -52,9 +52,13 @@ class SpotLight extends Light {
 		return angle = v;
 	}
 
-	function generatePrim() {
-		var points = new Array<h3d.col.Point>();
+	public static function spotLightPrim() {
+		var engine = h3d.Engine.getCurrent();
+		var p : h3d.prim.Polygon = @:privateAccess engine.resCache.get(SpotLight);
+		if( p != null )
+			return p;
 
+		var points = new Array<h3d.col.Point>();
 		// Left
 		points.push(new h3d.col.Point(0,0,0));
 		points.push(new h3d.col.Point(1,-1,-1));
@@ -78,18 +82,9 @@ class SpotLight extends Light {
 		points.push(new h3d.col.Point(1,1,1));
 		points.push(new h3d.col.Point(1,-1,1));
 		points.push(new h3d.col.Point(1,-1,-1));
+		p = new h3d.prim.Polygon(points);
+		p.addNormals();
 
-		var prim = new h3d.prim.Polygon(points);
-		prim.addNormals();
-		return prim;
-	}
-
-	public static function spotLightPrim() {
-		var engine = h3d.Engine.getCurrent();
-		var p : Polygon = @:privateAccess engine.resCache.get(SpotLight);
-		if( p != null )
-			return p;
-		p = generatePrim();
 		@:privateAccess engine.resCache.set(SpotLight, p);
 		return p;
 	}