Panagiotis Christopoulos Charitos пре 13 година
родитељ
комит
8b2742b78d

+ 1 - 1
include/anki/resource/Material.h

@@ -181,7 +181,7 @@ public:
 		return blendingDfactor;
 	}
 
-	bool getDepthTesting() const
+	bool getDepthTestingEnabled() const
 	{
 		return depthTesting;
 	}

+ 9 - 0
src/renderer/Drawer.cpp

@@ -508,6 +508,15 @@ void RenderableDrawer::setupShaderProg(
 	const Material& mtl = renderable.getMaterial();
 	const ShaderProgram& sprog = mtl.findShaderProgram(key);
 
+	if(mtl.getDepthTestingEnabled())
+	{
+		GlStateSingleton::get().enable(GL_DEPTH_TEST);
+	}
+	else
+	{
+		GlStateSingleton::get().disable(GL_DEPTH_TEST);
+	}
+
 	sprog.bind();
 	
 	SetUniformVisitor vis;

+ 0 - 7
src/resource/MaterialShaderProgramCreator.cpp

@@ -115,13 +115,6 @@ void MaterialShaderProgramCreator::parseShaderTag(
 		parseOperationTag(opPt);
 	} // end for all operations
 
-	if(type == "fragment")
-	{
-		srcLines.push_back("#if defined(fMsDiffuseFai_DEFINED)");
-		srcLines.push_back("fMsDiffuseFai = vec3(1.0);\n");
-		srcLines.push_back("#endif");
-	}
-
 	srcLines.push_back("}\n");
 }
 

+ 0 - 4
src/scene/VisibilityTester.cpp

@@ -4,15 +4,12 @@
 #include "anki/scene/Renderable.h"
 #include "anki/scene/Light.h"
 
-
 namespace anki {
 
-
 //==============================================================================
 VisibilityTester::~VisibilityTester()
 {}
 
-
 //==============================================================================
 void VisibilityTester::test(Frustumable& cam, Scene& scene,
 	VisibilityInfo& vinfo)
@@ -51,5 +48,4 @@ void VisibilityTester::test(Frustumable& cam, Scene& scene,
 	}
 }
 
-
 } // end namespace

+ 16 - 4
src/util/Filesystem.cpp

@@ -60,8 +60,14 @@ bool fileExists(const char* filename)
 {
 	ANKI_ASSERT(filename);
 	struct stat s;
-	stat(filename, &s);
-	return S_ISREG(s.st_mode);
+	if(stat(filename, &s) == 0)
+	{
+		return S_ISREG(s.st_mode);
+	}
+	else
+	{
+		return false;
+	}
 }
 
 //==============================================================================
@@ -69,8 +75,14 @@ bool directoryExists(const char* filename)
 {
 	ANKI_ASSERT(filename);
 	struct stat s;
-	stat(filename, &s);
-	return S_ISDIR(s.st_mode);
+	if(stat(filename, &s) == 0)
+	{
+		return S_ISDIR(s.st_mode);
+	}
+	else
+	{
+		return false;
+	}
 }
 
 //==============================================================================