From 4c534ee7b8f006c5edf314170c2131adf4283fdc Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 22 Apr 2010 13:18:11 +0000 Subject: [PATCH] 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 --- data/models/materials.xml | 14 ++++++++++++++ src/items/item_manager.cpp | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 data/models/materials.xml diff --git a/data/models/materials.xml b/data/models/materials.xml new file mode 100644 index 000000000..79a8b1a3b --- /dev/null +++ b/data/models/materials.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/items/item_manager.cpp b/src/items/item_manager.cpp index 61b3693be..b50542872 100644 --- a/src/items/item_manager.cpp +++ b/src/items/item_manager.cpp @@ -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 //-----------------------------------------------------------------------------