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

added loadingTextureColor (prevent flashing visual while loading texture)

ncannasse 10 жил өмнө
parent
commit
6e6db85b61

+ 1 - 0
h3d/impl/Driver.hx

@@ -52,6 +52,7 @@ enum Feature {
 class Driver {
 
 	public var logEnable : Bool;
+	public var loadingTextureColor = 0xFFFF00FF;
 
 	public function hasFeature( f : Feature ) {
 		return false;

+ 1 - 1
h3d/impl/GlDriver.hx

@@ -238,7 +238,7 @@ class GlDriver extends Driver {
 			for( i in 0...s.textures.length ) {
 				var t = buf.tex[i];
 				if( t == null || t.isDisposed() )
-					t = h3d.mat.Texture.fromColor(0xFF00FF);
+					t = h3d.mat.Texture.fromColor(loadingTextureColor,(loadingTextureColor>>>24)/255);
 				if( t != null && t.t == null && t.realloc != null ) {
 					t.alloc();
 					t.realloc();

+ 1 - 1
h3d/impl/Stage3dDriver.hx

@@ -478,7 +478,7 @@ class Stage3dDriver extends Driver {
 			for( i in 0...curShader.s.fragment.textures2DCount + curShader.s.fragment.texturesCubeCount ) {
 				var t = buffers.fragment.tex[i];
 				if( t == null || t.isDisposed() )
-					t = h3d.mat.Texture.fromColor(0xFF00FF);
+					t = h3d.mat.Texture.fromColor(loadingTextureColor,(loadingTextureColor>>>24)/255);
 				if( t != null && t.t == null && t.realloc != null ) {
 					t.alloc();
 					t.realloc();