瀏覽代碼

added loadingTextureColor (prevent flashing visual while loading texture)

ncannasse 10 年之前
父節點
當前提交
6e6db85b61
共有 3 個文件被更改,包括 3 次插入2 次删除
  1. 1 0
      h3d/impl/Driver.hx
  2. 1 1
      h3d/impl/GlDriver.hx
  3. 1 1
      h3d/impl/Stage3dDriver.hx

+ 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();