Commit 45f581d7 authored by hybrid's avatar hybrid

Fix coredump due to forgotten 0-check.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1481 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6d3e9efe
......@@ -826,13 +826,13 @@ void CB3DMeshFileLoader::loadTextures(SB3dMaterial& material) const
for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i)
{
SB3dTexture* B3dTexture = material.Textures[i];
if (B3dTexture->TextureName.size() && !material.Material.getTexture(i))
if (B3dTexture && B3dTexture->TextureName.size() && !material.Material.getTexture(i))
{
SceneManager->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, (B3dTexture->Flags & 0x8) ? true:false);
material.Material.setTexture(i, SceneManager->getVideoDriver()->getTexture( B3dTexture->TextureName.c_str() ));
if (material.Textures[i]->Flags & 0x10) // Clamp U
material.Material.TextureLayer[i].TextureWrap=video::ETC_CLAMP;
if (material.Textures[i]->Flags & 0x20) // Clamp V, TODO: Needs another attribute
if (material.Textures[i]->Flags & 0x20) // Clamp V
material.Material.TextureLayer[i].TextureWrap=video::ETC_CLAMP;
}
}
......
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