Fixed texture loading for .x files. Was trying to load the directory instead of the texture in the first try.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@867 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2007-08-28 22:36:54 +00:00
parent 0204279850
commit 4f27057696
1 changed files with 4 additions and 6 deletions

View File

@ -210,9 +210,9 @@ video::SMaterial CXAnimationPlayer::getMaterialFromXMaterial(const CXFileReader:
if (xmat.TextureFileName.size() != 0)
{
mat.Textures[0] = Driver->getTexture(getTextureFileName(xmat.TextureFileName).c_str());
mat.Textures[0] = Driver->getTexture(xmat.TextureFileName.c_str());
if (mat.Textures[0] == 0)
mat.Textures[0] = Driver->getTexture(xmat.TextureFileName.c_str());
mat.Textures[0] = Driver->getTexture(getTextureFileName(xmat.TextureFileName).c_str());
}
return mat;
@ -381,11 +381,9 @@ core::stringc CXAnimationPlayer::getTextureFileName(const core::stringc& texture
idx = FileName.findLast('\\');
if (idx == -1)
return core::stringc();
return texture;
core::stringc p = FileName.subString(0, idx+1);
p.append(texture);
return p;
return FileName.subString(idx+1, texture.size()-idx);
}