Commit 4f270576 authored by hybrid's avatar hybrid

Fixed texture loading for .x files. Was trying to load the directory instead...

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
parent 02042798
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment