Start to support 'externa' data directories. Most directories

from data can now be moved out (except music). STK prints
an overview of which directory is taken from where. More 
cleanups and improvements will come.
Also moved skins into a separate directory under data (from
data/skins), since it's likely that skins will be part
of a binary package (i.e. changes to skins not really
related to code), while gui files will more likely stay
with the code.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14731 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-12-17 23:48:47 +00:00
parent 248551bcb6
commit 73c498daf3
143 changed files with 433 additions and 515 deletions

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

View File

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -49,14 +49,14 @@ void AchievementsManager::deallocate()
// ============================================================================
AchievementsManager::AchievementsManager()
{
parseDataFile();
parseAssetFile();
}
// ============================================================================
void AchievementsManager::init()
{
parseConfigFile();
parseUserConfigFile();
}
// ============================================================================
@ -72,9 +72,9 @@ AchievementsManager::~AchievementsManager()
}
// ============================================================================
void AchievementsManager::parseDataFile()
void AchievementsManager::parseAssetFile()
{
const std::string file_name = file_manager->getDataFile("achievements.xml");
const std::string file_name = file_manager->getAsset("achievements.xml");
const XMLNode *root = file_manager->createXMLTree(file_name);
unsigned int num_nodes = root->getNumNodes();
for(unsigned int i = 0; i < num_nodes; i++)
@ -93,24 +93,28 @@ void AchievementsManager::parseDataFile()
}
else
{
Log::error("AchievementsManager::parseAchievements","Non-existent achievement type. Skipping - definitely results in unwanted behaviour.");
Log::error("AchievementsManager::parseAchievements",
"Non-existent achievement type. Skipping - "
"definitely results in unwanted behaviour.");
continue;
}
m_achievements_info[achievement_info->getID()] = achievement_info;
}
if(num_nodes != m_achievements_info.size())
Log::error("AchievementsManager::parseAchievements","Multiple achievements with the same id!");
Log::error("AchievementsManager::parseAchievements",
"Multiple achievements with the same id!");
}
// ============================================================================
void AchievementsManager::parseConfigFile()
void AchievementsManager::parseUserConfigFile()
{
const std::string filename=file_manager->getConfigFile("achievements.xml");
const std::string filename=file_manager->getUserConfigFile("achievements.xml");
XMLNode* root = file_manager->createXMLTree(filename);
if(!root || root->getName() != "achievements")
{
Log::info("AchievementsManager", "Achievements file '%s' will be created.",filename.c_str());
Log::info("AchievementsManager",
"Achievements file '%s' will be created.",filename.c_str());
createSlotsIfNeeded();
if (root) delete root;
return;
@ -169,7 +173,7 @@ void AchievementsManager::createSlotsIfNeeded()
// ============================================================================
void AchievementsManager::save()
{
std::string filename = file_manager->getConfigFile("achievements.xml");
std::string filename = file_manager->getUserConfigFile("achievements.xml");
std::ofstream achievements_file(filename.c_str(), std::ios::out);

View File

@ -46,8 +46,8 @@ private :
AchievementsManager ();
~AchievementsManager ();
AchievementsSlot * createNewSlot(std::string id, bool online);
void parseDataFile();
void parseConfigFile();
void parseAssetFile();
void parseUserConfigFile();
public:
/**Singleton */

View File

@ -20,7 +20,6 @@
#include "audio/music_manager.hpp"
#include "audio/sfx_buffer.hpp"
#include <sstream>
#include <stdexcept>
#include <algorithm>
#include <map>
@ -45,8 +44,6 @@
#include "race/race_manager.hpp"
#include "utils/constants.hpp"
#include <iostream>
SFXManager* sfx_manager= NULL;
std::map<std::string, SFXBase*> SFXManager::m_quick_sounds;
@ -147,11 +144,12 @@ bool SFXManager::sfxAllowed()
*/
void SFXManager::loadSfx()
{
std::string sfx_config_name = file_manager->getSFXFile("sfx.xml");
std::string sfx_config_name = file_manager->getAsset(FileManager::SFX, "sfx.xml");
XMLNode* root = file_manager->createXMLTree(sfx_config_name);
if (!root || root->getName()!="sfx-config")
{
std::cerr << "Could not read sounf effects XML file " << sfx_config_name.c_str() << std::endl;
Log::error("SFXManager", "Could not read sounf effects XML file '%s'.",
sfx_config_name.c_str());
}
int i;
@ -167,7 +165,8 @@ void SFXManager::loadSfx()
}
else
{
std::cerr << "Unknown node in sfx XML file : " << node->getName().c_str() << std::endl;
Log::warn("SFXManager", "Unknown node '%s' in sfx XML file '%s'.",
node->getName().c_str(), sfx_config_name.c_str());
throw std::runtime_error("Unknown node in sfx XML file");
}
}// nend for
@ -269,8 +268,9 @@ SFXBuffer* SFXManager::loadSingleSfx(const XMLNode* node,
// Only use the filename if no full path is specified. This is used
// to load terrain specific sfx.
const std::string full_path = (path == "") ? file_manager->getSFXFile(filename)
: path;
const std::string full_path = (path == "")
? file_manager->getAsset(FileManager::SFX,filename)
: path;
SFXBuffer tmpbuffer(full_path, node);

View File

@ -56,12 +56,13 @@ UnlockManager::UnlockManager()
// Read challenges from .../data/challenges
// ----------------------------------------
std::set<std::string> result;
file_manager->listFiles(result, "data/challenges");
std::string challenge_dir = file_manager->getAsset(FileManager::CHALLENGE, "");
file_manager->listFiles(result, challenge_dir, /*full_path*/true);
for(std::set<std::string>::iterator i = result.begin();
i != result.end() ; i++)
{
if (StringUtils::hasSuffix(*i, ".challenge"))
addChallenge(file_manager->getDataFile("challenges/"+*i));
addChallenge(file_manager->getAsset("challenges/"+*i));
} // for i
// Read challenges from .../data/tracks/*
@ -205,7 +206,7 @@ const ChallengeData* UnlockManager::getChallenge(const std::string& id)
*/
void UnlockManager::load()
{
const std::string filename=file_manager->getConfigFile("challenges.xml");
const std::string filename=file_manager->getUserConfigFile("challenges.xml");
XMLNode* root = file_manager->createXMLTree(filename);
if(!root || root->getName() != "challenges")
{
@ -264,7 +265,7 @@ void UnlockManager::load()
void UnlockManager::save()
{
std::string filename = file_manager->getConfigFile("challenges.xml");
std::string filename = file_manager->getUserConfigFile("challenges.xml");
std::ofstream challenge_file(filename.c_str(), std::ios::out);

View File

@ -267,8 +267,7 @@ void STKConfig::getAllData(const XMLNode * root)
music_node->get("title", &title_music);
assert(title_music.size() > 0);
m_title_music = MusicInformation::create(file_manager->getDataDir()
+ "/music/" + title_music );
m_title_music = MusicInformation::create(file_manager->getMusicFile(title_music));
if(!m_title_music)
Log::error("StkConfig", "Cannot load title music : %s", title_music.c_str());
}

View File

@ -798,7 +798,7 @@ bool operator>(const PlayerProfile &a, const PlayerProfile &b)
/** Load configuration values from file. */
bool UserConfig::loadConfig()
{
const std::string filename = file_manager->getConfigDir()+"/"+m_filename;
const std::string filename = file_manager->getUserConfigFile(m_filename);
XMLNode* root = file_manager->createXMLTree(filename);
if(!root || root->getName() != "stkconfig")
{
@ -888,14 +888,7 @@ void UserConfig::postLoadInit()
/** Write settings to config file. */
void UserConfig::saveConfig()
{
const std::string dir = file_manager->getConfigDir();
if(dir=="")
{
std::cerr << "User config firectory does not exist, cannot save config file!\n";
return;
}
const std::string filename = dir + "/" + m_filename;
const std::string filename = file_manager->getUserConfigFile(m_filename);
try
{

View File

@ -38,11 +38,12 @@ void HardwareSkinning::prepareNode(scene::IAnimatedMeshSceneNode *node)
HWSkinningCallback* callback = new HWSkinningCallback(node);
// Compile the shaders and associate the callback
s32 material_type = gpu->addHighLevelShaderMaterialFromFiles(
(file_manager->getShaderDir()+"skinning.vert").c_str(),
"main", video::EVST_VS_2_0, "",
"main", video::EPST_PS_2_0,
callback, video::EMT_SOLID);
std::string skinning = file_manager->getAssetChecked(FileManager::SHADER,
"skinning.vert", true);
s32 material_type = gpu->addHighLevelShaderMaterialFromFiles(skinning.c_str(),
"main", video::EVST_VS_2_0, "",
"main", video::EPST_PS_2_0,
callback, video::EMT_SOLID);
// Drop
callback->drop();

View File

@ -408,7 +408,11 @@ void IrrDriver::initDevice()
m_video_driver->beginScene(/*backBuffer clear*/true, /* Z */ false);
m_video_driver->endScene();
if (m_glsl)
// Stores the new file system pointer.
file_manager->reInit();
// if (m_glsl)
{
Log::info("irr_driver", "GLSL supported.");
@ -441,7 +445,7 @@ void IrrDriver::initDevice()
m_lensflare = new scene::CLensFlareSceneNode(NULL, m_scene_manager, -1);
video::ITexture * const tex =
m_video_driver->getTexture((file_manager->getTextureDir() + "lensflare.png").c_str());
m_video_driver->getTexture((file_manager->getTextureFile("lensflare.png")).c_str());
if (!tex) Log::fatal("irr_driver", "Cannot find lens flare texture");
m_lensflare->setMaterialTexture(0, tex);
m_lensflare->setAutomaticCulling(scene::EAC_OFF);
@ -450,7 +454,7 @@ void IrrDriver::initDevice()
m_suncam->grab();
m_suncam->setParent(NULL);
}
else
// else
{
Log::warn("irr_driver", "Using the fixed pipeline (old GPU, or shaders disabled in options)");
}
@ -492,9 +496,6 @@ void IrrDriver::initDevice()
} // If reinstating window location
} // If showing graphics
// Stores the new file system pointer.
file_manager->reInit();
// Initialize material2D
video::SMaterial& material2D = m_video_driver->getMaterial2D();
material2D.setFlag(video::EMF_ANTI_ALIASING, true);
@ -659,12 +660,12 @@ void IrrDriver::applyResolutionSettings()
input_manager->setMode(InputManager::MENU);
GUIEngine::addLoadingIcon(
irr_driver->getTexture(file_manager->getGUIDir()+"options_video.png")
);
irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"options_video.png"))
);
file_manager->pushTextureSearchPath(file_manager->getModelFile(""));
file_manager->pushTextureSearchPath(file_manager->getAsset(FileManager::MODEL,""));
const std::string materials_file =
file_manager->getModelFile("materials.xml");
file_manager->getAssetChecked(FileManager::MODEL, "materials.xml");
if (materials_file != "")
{
material_manager->addSharedMaterial(materials_file);
@ -675,7 +676,7 @@ void IrrDriver::applyResolutionSettings()
projectile_manager->loadData();
Referee::init();
GUIEngine::addLoadingIcon(
irr_driver->getTexture(file_manager->getGUIDir() + "gift.png") );
irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"gift.png")) );
file_manager->popTextureSearchPath();
@ -683,8 +684,8 @@ void IrrDriver::applyResolutionSettings()
kart_properties_manager->loadAllKarts();
attachment_manager->loadModels();
GUIEngine::addLoadingIcon(irr_driver->getTexture(file_manager->getGUIDir()
+ "banana.png") );
std::string banana = file_manager->getAsset(FileManager::GUI, "banana.png");
GUIEngine::addLoadingIcon(irr_driver->getTexture(banana) );
// No need to reload cached track data (track_manager->cleanAllCachedData
// above) - this happens dynamically when the tracks are loaded.
GUIEngine::reshowCurrentScreen();

View File

@ -513,7 +513,8 @@ void Material::initCustomSFX(const XMLNode *sfx)
// The directory for the track was added to the model search path
// so just misuse the getModelFile function
const std::string full_path = file_manager->getModelFile(filename);
const std::string full_path = file_manager->getAsset(FileManager::MODEL,
filename);
SFXBuffer* buffer = sfx_manager->loadSingleSfx(sfx, full_path);
if (buffer != NULL)
@ -837,7 +838,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
{
m->MaterialType = irr_driver->getShader(ES_CAUSTICS);
m->setTexture(1, irr_driver->getTexture((file_manager->getTextureDir() + "caustics.png").c_str()));
m->setTexture(1, irr_driver->getTexture(file_manager->getTextureFile("caustics.png")));
}

View File

@ -182,10 +182,12 @@ void MaterialManager::loadMaterial()
{
// Use temp material for reading, but then set the shared
// material index later, so that these materials are not popped
addSharedMaterial(file_manager->getTextureDir()+"materials.xml");
std::string deprecated = file_manager->getTextureDir()
+ "deprecated/materials.xml";
if(file_manager->fileExists(deprecated))
//
addSharedMaterial(file_manager->getAssetChecked(FileManager::TEXTURE,
"materials.xml", true));
std::string deprecated = file_manager->getAssetChecked(FileManager::TEXTURE,
"deprecated/materials.xml");
if(deprecated.size()>0)
addSharedMaterial(deprecated, true);
// Save index of shared textures

View File

@ -422,7 +422,8 @@ void ParticleEmitter::setParticleType(const ParticleKind* type)
}
else
{
m_node->setMaterialTexture(0, irr_driver->getTexture((file_manager->getDataDir() + "gui/main_help.png").c_str()));
std::string help = file_manager->getAsset(FileManager::GUI, "main_help.png");
m_node->setMaterialTexture(0, irr_driver->getTexture(help));
}
// velocity in m/ms

View File

@ -103,7 +103,8 @@ ParticleKind* ParticleKindManager::getParticles(const std::string &name)
{
try
{
ParticleKind* newkind = new ParticleKind(file_manager->getGfxFile(name));
std::string path = file_manager->getAsset(FileManager::GFX,name);
ParticleKind* newkind = new ParticleKind(path);
m_kinds[name] = newkind;
return newkind;
}

View File

@ -44,11 +44,8 @@ video::ITexture *Referee::m_st_traffic_lights[3] = {NULL, NULL, NULL};
void Referee::init()
{
assert(!m_st_referee_mesh);
const std::string filename=file_manager->getModelFile("referee.xml");
if(filename=="")
{
Log::fatal("referee", "Can't find referee.xml, aborting.");
}
const std::string filename=file_manager->getAssetChecked(FileManager::MODEL,
"referee.xml", true);
XMLNode *node = file_manager->createXMLTree(filename);
if(!node)
{
@ -63,7 +60,8 @@ void Referee::init()
node->get("model", &model_filename);
m_st_referee_mesh = irr_driver->getAnimatedMesh(
file_manager->getModelFile(model_filename) );
file_manager->getAsset(FileManager::MODEL,
model_filename) );
if(!m_st_referee_mesh)
{
Log::fatal("referee", "Can't find referee model '%s', aborting.",

View File

@ -803,7 +803,7 @@ void IrrDriver::renderDisplacement(video::SOverrideMaterial &overridemat,
overridemat.Material.MaterialType = m_shaders->getShader(ES_DISPLACE);
overridemat.Material.TextureLayer[0].Texture =
irr_driver->getTexture((file_manager->getTextureDir() + "displace.png").c_str());
irr_driver->getTexture(file_manager->getTextureFile("displace.png"));
overridemat.Material.TextureLayer[0].BilinearFilter =
overridemat.Material.TextureLayer[0].TrilinearFilter = true;
overridemat.Material.TextureLayer[0].AnisotropicFilter = 0;

Some files were not shown because too many files have changed in this diff Show More