Textures for models are now taken from the models directory, not from

the shared texture directory anymore (some work might still have to be done).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5237 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-04-22 13:18:11 +00:00
parent 3670951f02
commit 4c534ee7b8
2 changed files with 22 additions and 0 deletions

14
data/models/materials.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<materials>
<material name="banana.png" alpha="0.5" collide="N"/>
<material name="gift-box.png" sphere="N" collide="N"/>
<material name="gift-loop.png" sphere="Y" collide="N"/>
<material name="gold.png" light="Y" sphere="Y" collide="N"/>
<material name="nitro-tank.png" clampV="Y" transparency="Y" alpha="0.5" collide="N"/>
<material name="tank-blue.png" sphere="Y" collide="N"/>
<material name="tank-green.png" sphere="Y" collide="N"/>
<material name="tank-cyan.png" sphere="Y" collide="N"/>
<material name="parachute.png" backface-culling="n" ignore="Y" collide="N"/>
<material name="zipper.png" light="N" zipper="Y" collide="N"/>
</materials>

View File

@ -94,6 +94,11 @@ ItemManager::~ItemManager()
//-----------------------------------------------------------------------------
void ItemManager::loadDefaultItems()
{
file_manager->pushTextureSearchPath(file_manager->getModelFile(""));
const std::string materials_file = file_manager->getModelFile("materials.xml");
if(materials_file!="")
material_manager->pushTempMaterial(materials_file);
// The names must be given in the order of the definition of ItemType
// in item.hpp. Note that bubblegum strictly isn't an item,
// it is implemented as one, and so loaded here, too.
@ -125,6 +130,9 @@ void ItemManager::loadDefaultItems()
m_item_mesh[i] = mesh;
mesh->grab();
} // for i
if(materials_file!="")
material_manager->popTempMaterial();
file_manager->popTextureSearchPath();
} // loadDefaultItems
//-----------------------------------------------------------------------------