From: <mbj...@us...> - 2011-01-03 04:39:25
|
Revision: 7222 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7222&view=rev Author: mbjornstk Date: 2011-01-03 04:39:18 +0000 (Mon, 03 Jan 2011) Log Message: ----------- Update comment about items' fog, remove some lighting flags that just hide wrong export options (resave with normals to fix) and make the items look 2d. Modified Paths: -------------- main/trunk/src/items/item_manager.cpp main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/items/item_manager.cpp =================================================================== --- main/trunk/src/items/item_manager.cpp 2011-01-03 03:34:16 UTC (rev 7221) +++ main/trunk/src/items/item_manager.cpp 2011-01-03 04:39:18 UTC (rev 7222) @@ -99,7 +99,7 @@ // in item.hpp. Note that bubblegum strictly isn't an item, // it is implemented as one, and so loaded here, too. static const std::string item_names[] = {"bonus-box", "banana", - "nitro-big", "nitro-small", + "nitro-big", "nitro-small", "bubblegum" }; const std::string file_name = file_manager->getDataFile("items.xml"); const XMLNode *root = file_manager->createXMLTree(file_name); @@ -116,12 +116,13 @@ 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); + // If items show the polygons instead of being smooth re-export with + // normals (that was bananas' problem) but do not disable this flag + //mesh->setMaterialFlag(video::EMF_LIGHTING, false); + // FIXME this should check if current track uses fog or not + // otherwise items look wrong when far away and track has no fog mesh->setMaterialFlag(video::EMF_FOG_ENABLE, true); - std::string shortName = + std::string shortName = StringUtils::getBasename(StringUtils::removeExtension(model_filename)); m_all_meshes[shortName] = mesh; m_item_mesh[i] = mesh; Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-01-03 03:34:16 UTC (rev 7221) +++ main/trunk/src/tracks/track_object.cpp 2011-01-03 04:39:18 UTC (rev 7222) @@ -90,7 +90,9 @@ m_node->setPosition(m_init_xyz); m_node->setRotation(m_init_hpr); m_node->setScale(m_init_scale); - m_node->setMaterialFlag(video::EMF_LIGHTING, false); + // FIXME (to-be-removed) If something looks polygonal + // re-export with normals instead of setting false here + //m_node->setMaterialFlag(video::EMF_LIGHTING, false); } reset(); } // TrackObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |