Fix a bug in new meshtextureloader - don't set old TEXTURE_PATHS always but only if people still use those parameters or we overwrite the new way to set paths.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4710 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-03-03 17:33:35 +00:00
parent a969bed775
commit 940d2e4238
5 changed files with 14 additions and 5 deletions

View File

@ -1036,6 +1036,7 @@ void CB3DMeshFileLoader::loadTextures(SB3dMaterial& material) const
{ {
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{ {
if ( SceneManager->getParameters()->existsAttribute(B3D_TEXTURE_PATH) )
getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(B3D_TEXTURE_PATH) ); getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(B3D_TEXTURE_PATH) );
} }

View File

@ -412,7 +412,10 @@ namespace scene
scene::IMesh* CCSMLoader::createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix) scene::IMesh* CCSMLoader::createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix)
{ {
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{
if ( SceneManager->getParameters()->existsAttribute(CSM_TEXTURE_PATH) )
getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(CSM_TEXTURE_PATH) ); getMeshTextureLoader()->setTexturePath( SceneManager->getParameters()->getAttributeAsString(CSM_TEXTURE_PATH) );
}
scene::SMesh *pMesh = new scene::SMesh(); scene::SMesh *pMesh = new scene::SMesh();
video::IVideoDriver* driver = SceneManager->getVideoDriver(); video::IVideoDriver* driver = SceneManager->getVideoDriver();

View File

@ -333,7 +333,10 @@ void CLMTSMeshFileLoader::loadTextures(SMesh* mesh)
id2id.reallocate(Header.TextureCount); id2id.reallocate(Header.TextureCount);
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{
if ( Parameters->existsAttribute(LMTS_TEXTURE_PATH) )
getMeshTextureLoader()->setTexturePath(Parameters->getAttributeAsString(LMTS_TEXTURE_PATH)); getMeshTextureLoader()->setTexturePath(Parameters->getAttributeAsString(LMTS_TEXTURE_PATH));
}
core::stringc s; core::stringc s;
for (u32 t=0; t<Header.TextureCount; ++t) for (u32 t=0; t<Header.TextureCount; ++t)

View File

@ -84,6 +84,7 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{ {
getMeshTextureLoader()->setMeshFile(file); getMeshTextureLoader()->setMeshFile(file);
if ( SceneManager->getParameters()->existsAttribute(MY3D_TEXTURE_PATH) )
getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(MY3D_TEXTURE_PATH)); getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(MY3D_TEXTURE_PATH));
} }

View File

@ -487,6 +487,7 @@ void COBJMeshFileLoader::readMTL(const c8* fileName, const io::path& relPath)
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{ {
getMeshTextureLoader()->setMaterialFile(mtlReader); getMeshTextureLoader()->setMaterialFile(mtlReader);
if ( SceneManager->getParameters()->existsAttribute(OBJ_TEXTURE_PATH) )
getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(OBJ_TEXTURE_PATH)); getMeshTextureLoader()->setTexturePath(SceneManager->getParameters()->getAttributeAsString(OBJ_TEXTURE_PATH));
} }