2
0
Эх сурвалжийг харах

removed Engine.frameCount, use hxd.Timer.frameCount instead

ncannasse 6 жил өмнө
parent
commit
d4d1103fec

+ 0 - 2
h2d/Scene.hx

@@ -439,7 +439,6 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 			ctx.engine.clear(0);
 		s.drawRec(ctx);
 		ctx.popTarget();
-		ctx.engine.frameCount--;
 	}
 
 	/**
@@ -506,7 +505,6 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
 		posChanged = true;
 		engine.setRenderZone();
 		engine.end();
-		engine.frameCount--;
 		return new Bitmap(target);
 	}
 

+ 1 - 3
h3d/Engine.hx

@@ -34,7 +34,6 @@ class Engine {
 	public var fullScreen(default, set) : Bool;
 
 	public var fps(get, never) : Float;
-	public var frameCount : Int = 0;
 
 	var realFps : Float;
 	var lastTime : Float;
@@ -278,7 +277,6 @@ class Engine {
 		if( driver.isDisposed() )
 			return false;
 		// init
-		frameCount++;
 		drawTriangles = 0;
 		shaderSwitches = 0;
 		drawCalls = 0;
@@ -287,7 +285,7 @@ class Engine {
 		#if usesys
 		haxe.System.beginFrame();
 		#end
-		driver.begin(frameCount);
+		driver.begin(hxd.Timer.frameCount);
 		if( backgroundColor != null ) clear(backgroundColor, 1, 0);
 		return true;
 	}

+ 1 - 1
h3d/impl/MemoryManager.hx

@@ -237,7 +237,7 @@ class MemoryManager {
 		textures.sort(sortByLRU);
 		for( t in textures ) {
 			if( t.realloc == null ) continue;
-			if( force || t.lastFrame < h3d.Engine.getCurrent().frameCount - 3600 ) {
+			if( force || t.lastFrame < hxd.Timer.frameCount - 3600 ) {
 				t.dispose();
 				return true;
 			}

+ 2 - 0
h3d/mat/Pass.hx

@@ -2,7 +2,9 @@ package h3d.mat;
 import h3d.mat.Data;
 
 @:allow(h3d.mat.BaseMaterial)
+#if !macro
 @:build(hxd.impl.BitsBuilder.build())
+#end
 class Pass implements hxd.impl.Serializable {
 
 	@:s public var name(default, null) : String;

+ 1 - 5
hxd/Key.hx

@@ -130,11 +130,7 @@ class Key {
 	}
 
 	public static inline function getFrame() {
-		#if noEngine
-		return frameCount;
-		#else
-		return h3d.Engine.getCurrent().frameCount + 1;
-		#end
+		return hxd.Timer.frameCount + 1;
 	}
 
 	public static function isPressed( code : Int ) {