skipped loading of texture if mesh has no textures. Thanks to Lorenzo Marchi

This commit is contained in:
Paolo Cignoni cignoni 2008-11-27 23:53:53 +00:00
parent 93dcfc93c0
commit 9b8f9bfafb

View File

@ -114,9 +114,11 @@ void RenderRFX::Init(QAction *action, MeshModel &mesh,
RfxParser theParser(QDir(shaderDir).absoluteFilePath(action->text()));
// Small hack that allow to use the current mesh textures for the shaders.
QFileInfo meshBaseDir(mesh.fileName.c_str());
theParser.setMeshTexture(meshBaseDir.absolutePath()+"/"+QString(mesh.cm.textures[0].c_str()));
if(mesh.cm.textures.size()>0)
{
QFileInfo meshBaseDir(mesh.fileName.c_str());
theParser.setMeshTexture(meshBaseDir.absolutePath()+"/"+QString(mesh.cm.textures[0].c_str()));
}
assert(theParser.Parse());
activeShader = theParser.GetShader();
assert(activeShader);