the log without any fixes: (believe me that the list is a few times longer )
here the log with the "fixed" loader
I made a quick hotfix. I don't know if that really fixes the real problem, but it achieves that the textures get loaded only one time.
I changed
Code: Select all
if (Name.size()>0)
{
me.Texture2 = Driver->getTexture(me.Texture2FileName.c_str());
ligCount++;
}
Code: Select all
if (Name.size()>0)
{
////////////////////////////////////////////////////////////
//check if texture was loaded before
for(s32 p=0; p<m;p++)
{
if(!strcmp(MaterialEntry[p].Texture2FileName.c_str(), me.Texture2FileName.c_str()))
{
me.Texture2 = MaterialEntry[p].Texture2;
break;
}
else if(p==(m-1))
{
me.Texture2 = Driver->getTexture(me.Texture2FileName.c_str());
ligCount++;
}
}
if(m==0)
{
me.Texture2 = Driver->getTexture(me.Texture2FileName.c_str());
ligCount++;
}
///////////////////////////////////////////////////
}
I know that this is a really messy code-style (damn, it's about 3 am in germany ), so I hope that a more skilled person hunts this bug down.