TGEA 1.8.1 gfxTextureManager bug (& fix) with DDS file paths
by Konrad Kiss · in Torque Game Engine Advanced · 02/13/2009 (6:28 am) · 2 replies
In gfx/gfxTextureManager.cpp the following line will not work with a filename that has a "double" extension.
Example: base.head.dds - function called with the value base.head without extension.
Around line 618:
That = will assign a value, while calling Path::_split that will reparse the path and think of "head" as the extension. Then that extension is overwritten by "dds", so the file that will be searched for at the end of the day is "base.dds".
The following fixes this:
Example: base.head.dds - function called with the value base.head without extension.
Around line 618:
// Check to see if there is a .DDS file with this name (if no extension is provided)
Torque::Path tryDDSPath = pathNoExt;
tryDDSPath.setExtension( "dds" );That = will assign a value, while calling Path::_split that will reparse the path and think of "head" as the extension. Then that extension is overwritten by "dds", so the file that will be searched for at the end of the day is "base.dds".
The following fixes this:
// Check to see if there is a .DDS file with this name (if no extension is provided)
Torque::Path tryDDSPath = pathNoExt;
if (!tryDDSPath.getExtension().equal("", String::NoCase)) {
tryDDSPath.setFileName( Torque::Path::Join( tryDDSPath.getFileName(), '.', tryDDSPath.getExtension() ) );
}
tryDDSPath.setExtension( "dds" );About the author
http://about.me/konrad.kiss
#2
Actually, you made a check for this at the beginning of the function, I just used my copy / paste skills to solve it. Hehe.
02/13/2009 (2:49 pm)
Thanks MattActually, you made a check for this at the beginning of the function, I just used my copy / paste skills to solve it. Hehe.
Associate Matt Fairfax
PopCap
I spent a long time fixing up that issue for everything *but* DDS...doh!