Applied patch by samuncle to support disabling backface culling, thanks! (even though I helped quite a bit ;)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6735 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-11-26 01:02:33 +00:00
parent ec93b9889a
commit 5b7d055f2c
2 changed files with 13 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ Material::Material(const XMLNode *node, int index)
node->get("max-speed", &m_max_speed_fraction);
node->get("slowdown-time", &m_slowdown_time );
node->get("anisotropic", &m_anisotropic );
node->get("noculling", &m_disable_cull );
node->get("backface-culling", &m_backface_culling );
std::string s("");
node->get("graphical-effect", &s );
@@ -269,6 +270,7 @@ void Material::setMaterialProperties(video::SMaterial *m) const
m->SpecularColor = video::SColor(255, 255, 255, 255);
}
// anisotropic
if (m_anisotropic && UserConfigParams::m_anisotropic)
{
m->setFlag(video::EMF_ANISOTROPIC_FILTER, true);
@@ -278,6 +280,14 @@ void Material::setMaterialProperties(video::SMaterial *m) const
m->setFlag(video::EMF_TRILINEAR_FILTER, true);
}
// noculling
if (m_disable_cull)
{
m->setFlag( irr::video::EMF_BACK_FACE_CULLING , false );
}
if ( (m_clamp_tex & UCLAMP) != 0)
{
// m->setFlag();

View File

@@ -62,6 +62,9 @@ private:
/** Whether to use anisotropic filtering for this texture */
bool m_anisotropic;
/** Disable the culling **/
bool m_disable_cull;
/** True if lightmapping is enabled for this material. */
bool m_lightmap;
float m_friction;