Fix For "could Not Locate Texture: Null,origin,trigger,ffield
by Tom Spilman · in Torque Game Engine · 06/02/2005 (4:38 pm) · 9 replies
This issue comes up from time to time. So i decided to finally submit a patch for it. This is a rather simple change at the top of Interior::prepForRendering() in interior.cc:
I tested it in 1.4 RC1 and it seems to work perfectly. I think this issue was fixed in TSE in a different way already, so it probably doesn't apply there.
bool Interior::prepForRendering(const char* path)
{
if (mPreppedForRender == true)
return true;
// Before we load the material list we temporarily remove
// some special texture names so that we don't get bogus
// texture load warnings in the console.
VectorPtr<char*> MatNames;
MatNames = mMaterialList->mMaterialNames;
VectorPtr<char*>::iterator iter = mMaterialList->mMaterialNames.begin();
for ( ; iter != mMaterialList->mMaterialNames.end(); iter++ )
{
if ( *iter &&
( dStrcmp( *iter, "NULL" ) == 0 ||
dStrcmp( *iter, "ORIGIN" ) == 0 ||
dStrcmp( *iter, "TRIGGER" ) == 0 ||
dStrcmp( *iter, "FORCEFIELD" ) == 0 ) )
{
*iter = NULL;
}
}
// Load the material list
bool matListSuccess = mMaterialList->load(InteriorTexture, path, false);
// Now restore the material names since someone later may
// count on the special texture names being present.
mMaterialList->mMaterialNames = MatNames;
// REST OF FUNCTIONI tested it in 1.4 RC1 and it seems to work perfectly. I think this issue was fixed in TSE in a different way already, so it probably doesn't apply there.
About the author
Tom is a programmer and co-owner of Sickhead Games, LLC.
#3
06/02/2005 (6:32 pm)
Is there a way to see the known bugs list? Fixing bugs might be a good way to learn more about the engine for me :)
#4
06/02/2005 (6:34 pm)
Yea Ben. Put up a new topic with your top 100 most wanted bug fixes. Maybe offer up some prizes for the most fixed bugs... like a GG mug or something. Get creative man! =)
#5
06/02/2005 (7:42 pm)
Definitely something on our list of tasks. As TDN moves along (which it is now that I'm done with MS2!) we'll be putting more of that stuff out there for public/associates to play with.
#6
06/02/2005 (9:14 pm)
Great job Tom. This was one of my pet hates for no particular reason. I just dislike console spam and was going to edit it out eventually.
#7
also great idea on having the top 100 bugs public with prizes offered
06/04/2005 (12:16 pm)
Thanks Tom!also great idea on having the top 100 bugs public with prizes offered
#8
06/04/2005 (1:13 pm)
Thanks Tom, good fix!
#9
06/30/2005 (4:24 pm)
YaY! i can remove the extra images now:) lol
Associate Kyle Carter
Thanks, Tom. Nice fix.