Instead of switching light off whenever a new mesh is set, change the light

settings once in the original 'master mesh'.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4656 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-02-07 03:59:03 +00:00
parent 4aa664e124
commit 3116f475cd
2 changed files with 4 additions and 6 deletions

View File

@ -42,10 +42,6 @@ Item::Item(ItemType type, const Vec3& xyz, const Vec3& normal,
m_time_till_return = 0.0f; // not strictly necessary, see isCollected()
m_original_mesh = mesh;
m_node = irr_driver->addMesh(mesh);
// If lighting would be enabled certain items (esp. bananas)
// don't look smooth, so for now generally disable lighting
// FIXME : re-export models with normals instead
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
m_node->setPosition(xyz.toIrrVector());
m_node->grab();
} // Item
@ -60,7 +56,6 @@ void Item::switchTo(ItemType type, scene::IMesh *mesh)
m_original_type = m_type;
m_type = type;
m_node->setMesh(mesh);
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
} // switchTo
//-----------------------------------------------------------------------------
@ -72,7 +67,6 @@ void Item::switchBack()
m_type = m_original_type;
m_original_type = ITEM_NONE;
m_node->setMesh(m_original_mesh);
m_node->setMaterialFlag(video::EMF_LIGHTING, false);
} // switchBack
//-----------------------------------------------------------------------------

View File

@ -119,6 +119,10 @@ void ItemManager::loadDefaultItems()
item_names[i].c_str());
exit(-1);
}
// If lighting would be enabled certain items (esp. bananas)
// don't look smooth, so for now generally disable lighting
// FIXME : re-export models with normals instead
mesh->setMaterialFlag(video::EMF_LIGHTING, false);
std::string shortName =
StringUtils::getBasename(StringUtils::removeExtension(model_filename));
m_all_meshes[shortName] = mesh;