PowerupManager now loads its texture from models subdirectory, too

(including materials.xml file). Moved icons for those models
to model directory, too.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5247 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-04-23 12:54:15 +00:00
parent f1a296fa42
commit a572f7bf1b
11 changed files with 33 additions and 20 deletions

BIN
data/models/anchor-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
data/models/cake-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,14 +1,21 @@
<?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"/>
<material name="banana.png" alpha="0.5"/>
<material name="gift-box.png"/>
<material name="gift-loop.png" sphere="Y"/>
<material name="gold.png" light="Y" sphere="Y"/>
<material name="nitro-tank.png" clampV="Y" transparency="Y" alpha="0.5"/>
<material name="tank-blue.png" sphere="Y"/>
<material name="tank-green.png" sphere="Y"/>
<material name="tank-cyan.png" sphere="Y"/>
<material name="parachute.png" backface-culling="n" ignore="Y"/>
<material name="zipper.png" light="N" zipper="Y"/>
<material name="zipper_collect.png" light="N" zipper="Y"/>
<material name="bowling-icon.png" transparency="Y" light="N"/>
<material name="bubblegum-icon.png" transparency="Y" light="N"/>
<material name="cake-icon.png" transparency="Y" light="N" />
<material name="anchor-icon.png" clampU="Y" clampV="Y" transparency="Y" light="N" ignore="Y"/>
<material name="plunger-icon.png" transparency="Y" light="N"/>
<material name="parachute-icon.png" clampU="Y" clampV="Y" ignore="Y"/>
</materials>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
data/models/swap-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -94,11 +94,6 @@ 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.
@@ -130,9 +125,6 @@ void ItemManager::loadDefaultItems()
m_item_mesh[i] = mesh;
mesh->grab();
} // for i
if(materials_file!="")
material_manager->popTempMaterial();
file_manager->popTextureSearchPath();
} // loadDefaultItems
//-----------------------------------------------------------------------------

View File

@@ -615,8 +615,22 @@ int main(int argc, char *argv[] )
kart_properties_manager -> loadAllKarts ();
unlock_manager = new UnlockManager();
projectile_manager -> loadData ();
powerup_manager -> loadAllPowerups ();
item_manager -> loadDefaultItems();
// Both item_manager and powerup_manager load models and therefore
// textures from the model directory. To avoid reading the
// materials.xml twice, we do this here once for both:
file_manager->pushTextureSearchPath(file_manager->getModelFile(""));
const std::string materials_file = file_manager->getModelFile("materials.xml");
if(materials_file!="")
material_manager->pushTempMaterial(materials_file);
{
powerup_manager -> loadAllPowerups ();
item_manager -> loadDefaultItems();
}
if(materials_file!="")
material_manager->popTempMaterial();
file_manager->popTextureSearchPath();
attachment_manager -> loadModels ();
// Init GUI prepare main menu