From 11bf9d15c7a6e96db316e771da7093418c9c23ed Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Wed, 1 Oct 2014 20:23:22 -0400 Subject: [PATCH 1/2] Disable source of OpenGL warnings flood in code we don't use --- lib/irrlicht/source/Irrlicht/CGUIButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp index 21be74646..d4e6d9a91 100644 --- a/lib/irrlicht/source/Irrlicht/CGUIButton.cpp +++ b/lib/irrlicht/source/Irrlicht/CGUIButton.cpp @@ -285,7 +285,7 @@ void CGUIButton::draw() } } - if (SpriteBank) + if (false) //SpriteBank) { // pressed / unpressed animation u32 state = Pressed ? (u32)EGBS_BUTTON_DOWN : (u32)EGBS_BUTTON_UP; From bdb722df458a2d4c0437a98197f24a193ad4fd1e Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Wed, 1 Oct 2014 20:26:39 -0400 Subject: [PATCH 2/2] Fix splatting --- src/graphics/stkanimatedmesh.cpp | 6 +++++- src/graphics/stkmesh.cpp | 8 ++++++-- src/graphics/stkmesh.hpp | 3 ++- src/graphics/stkmeshscenenode.cpp | 10 ++++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/graphics/stkanimatedmesh.cpp b/src/graphics/stkanimatedmesh.cpp index 02f251cd1..7f168c2db 100644 --- a/src/graphics/stkanimatedmesh.cpp +++ b/src/graphics/stkanimatedmesh.cpp @@ -142,7 +142,11 @@ void STKAnimatedMesh::updateGL() if (!rnd->isTransparent()) { Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb); - Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material); + Material* material2 = NULL; + if (mb->getMaterial().getTexture(1) != NULL) + material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb); + + Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2); InitTextures(mesh, MatType); } diff --git a/src/graphics/stkmesh.cpp b/src/graphics/stkmesh.cpp index 0d78ccac0..6dd3c3114 100644 --- a/src/graphics/stkmesh.cpp +++ b/src/graphics/stkmesh.cpp @@ -11,12 +11,16 @@ #include "modes/world.hpp" -Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, Material* material) +Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, + Material* material, Material* layer2Material) { + if (layer2Material != NULL && layer2Material->getShaderType() == Material::SHADERTYPE_SPLATTING) + return Material::SHADERTYPE_SPLATTING; + switch (material->getShaderType()) { default: - return material->getShaderType(); + return material->getShaderType(); case Material::SHADERTYPE_SOLID: if (MaterialType == irr_driver->getShader(ES_NORMAL_MAP)) return Material::SHADERTYPE_NORMAL_MAP; diff --git a/src/graphics/stkmesh.hpp b/src/graphics/stkmesh.hpp index 574036b88..df533c031 100644 --- a/src/graphics/stkmesh.hpp +++ b/src/graphics/stkmesh.hpp @@ -174,7 +174,8 @@ class ListDisplacement : public MiscList, public std::vector {}; -Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, Material* material); +Material::ShaderType MaterialTypeToMeshMaterial(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp, + Material* material, Material* layer2Material); TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE, f32 MaterialTypeParam, Material* material); void InitTextures(GLMesh &mesh, Material::ShaderType); diff --git a/src/graphics/stkmeshscenenode.cpp b/src/graphics/stkmeshscenenode.cpp index 1ede864ec..b23973b25 100644 --- a/src/graphics/stkmeshscenenode.cpp +++ b/src/graphics/stkmeshscenenode.cpp @@ -143,7 +143,10 @@ void STKMeshSceneNode::updateNoGL() else { assert(!isDisplacement); - Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material); + Material* material2 = NULL; + if (mb->getMaterial().getTexture(1) != NULL) + material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb); + Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2); if (!immediate_draw) MeshSolidMaterial[MatType].push_back(&mesh); } @@ -179,7 +182,10 @@ void STKMeshSceneNode::updateGL() if (!rnd->isTransparent()) { Material* material = material_manager->getMaterialFor(mb->getMaterial().getTexture(0), mb); - Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material); + Material* material2 = NULL; + if (mb->getMaterial().getTexture(1) != NULL) + material2 = material_manager->getMaterialFor(mb->getMaterial().getTexture(1), mb); + Material::ShaderType MatType = MaterialTypeToMeshMaterial(type, mb->getVertexType(), material, material2); if (!immediate_draw) InitTextures(mesh, MatType); }