Some code cleanup.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3813 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-08-06 05:11:16 +00:00
parent 6bed41add5
commit 671fde19cf
2 changed files with 11 additions and 13 deletions

View File

@ -87,14 +87,14 @@ void ItemManager::loadDefaultItems()
/*make_full_path*/true); /*make_full_path*/true);
for(std::set<std::string>::iterator i = files.begin(); for(std::set<std::string>::iterator i = files.begin();
i != files.end(); ++i) i != files.end(); ++i)
{ {
if(StringUtils::extension(*i)!="b3d") continue; if(StringUtils::extension(*i)!="b3d") continue;
scene::IMesh *mesh = irr_driver->getAnimatedMesh(*i); scene::IMesh *mesh = irr_driver->getAnimatedMesh(*i);
if(!mesh) continue; if(!mesh) continue;
std::string shortName = StringUtils::basename(StringUtils::without_extension(*i)); std::string shortName = StringUtils::basename(StringUtils::without_extension(*i));
m_all_meshes[shortName] = mesh; m_all_meshes[shortName] = mesh;
mesh->grab(); mesh->grab();
} // for i } // for i
setDefaultItemStyle(); setDefaultItemStyle();
} // loadDefaultItems } // loadDefaultItems

View File

@ -60,11 +60,8 @@ PhysicalObject::PhysicalObject(const XMLNode *xml_node)
m_node = irr_driver->addMesh(m_mesh); m_node = irr_driver->addMesh(m_mesh);
//m_node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); //m_node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
Vec3 xyz(0,0,0); Vec3 xyz(0,0,0);
int result = xml_node->getXYZ(&xyz); int result = xml_node->get("xyz", &xyz);
if(!XMLNode::hasZ(result)) // needs height xyz.setZ(RaceManager::getTrack()->getTerrainHeight(xyz));
{
xyz.setZ(RaceManager::getTrack()->getTerrainHeight(xyz));
}
Vec3 hpr(0,0,0); Vec3 hpr(0,0,0);
result = xml_node->getHPR(&hpr); result = xml_node->getHPR(&hpr);
if(!XMLNode::hasP(result) || if(!XMLNode::hasP(result) ||
@ -106,6 +103,7 @@ PhysicalObject::~PhysicalObject()
*/ */
void PhysicalObject::init() void PhysicalObject::init()
{ {
assert(m_mesh);
// 1. Determine size of the object // 1. Determine size of the object
// ------------------------------- // -------------------------------
Vec3 min, max; Vec3 min, max;