diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index 81dbcd817..d2e47ccea 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -2,6 +2,7 @@ // // SuperTuxKart - a fun racing game with go-kart // Copyright (C) 2004 Steve Baker +// 2010 Steve Baker, Joerg Henrichs // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -62,6 +63,7 @@ Material::Material(const XMLNode *node, int index) node->get("max-speed", &m_max_speed_fraction); node->get("slowdown", &m_slowdown ); node->get("anisotropic", &m_anisotropic ); + node->get("backface-culling", &m_backface_culling ); std::string s(""); node->get("graphical-effect", &s ); if(s=="water") @@ -105,6 +107,7 @@ void Material::init(unsigned int index) m_alpha_blending = false; m_lighting = true; m_anisotropic = false; + m_backface_culling = true; m_sphere_map = false; m_friction = 1.0f; m_ignore = false; @@ -199,5 +202,8 @@ void Material::setMaterialProperties(video::SMaterial *m) const } #endif - // FIXME: more parameters need to be set! + + if(!m_backface_culling) + m->setFlag(video::EMF_BACK_FACE_CULLING, false); + } // setMaterialProperties diff --git a/src/graphics/material.hpp b/src/graphics/material.hpp index 07ad6f314..076b7ce70 100644 --- a/src/graphics/material.hpp +++ b/src/graphics/material.hpp @@ -46,6 +46,9 @@ private: bool m_sphere_map; bool m_alpha_testing; bool m_alpha_blending; + + /** True if backface culliing should be enabled. */ + bool m_backface_culling; /** Whether to use anisotropic filtering for this texture */ bool m_anisotropic;