File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Generals/Code/Libraries/Source/WWVegas/WW3D2 Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2201,12 +2201,28 @@ IDirect3DSurface8 * DX8Wrapper::_Create_DX8_Surface(const char *filename_)
2201
2201
// If file not found, create a surface with missing texture in it
2202
2202
2203
2203
if (!myfile->Is_Available ()) {
2204
- return MissingTexture::_Create_Missing_Surface ();
2204
+ // If file not found, try the dds format
2205
+ // else create a surface with missing texture in it
2206
+ char compressed_name[200 ];
2207
+ strncpy (compressed_name,filename_, 200 );
2208
+ char *ext = strstr (compressed_name, " ." );
2209
+ if ( (strlen (ext)==4 ) &&
2210
+ ( (ext[1 ] == ' t' ) || (ext[1 ] == ' T' ) ) &&
2211
+ ( (ext[2 ] == ' g' ) || (ext[2 ] == ' G' ) ) &&
2212
+ ( (ext[3 ] == ' a' ) || (ext[3 ] == ' A' ) ) ) {
2213
+ ext[1 ]=' d' ;
2214
+ ext[2 ]=' d' ;
2215
+ ext[3 ]=' s' ;
2216
+ }
2217
+ file_auto_ptr myfile2 (_TheFileFactory,compressed_name);
2218
+ if (!myfile2->Is_Available ())
2219
+ return MissingTexture::_Create_Missing_Surface ();
2205
2220
}
2206
2221
}
2207
2222
2223
+ StringClass filename_string (filename_,true );
2208
2224
surface=TextureLoader::Load_Surface_Immediate (
2209
- filename_ ,
2225
+ filename_string ,
2210
2226
WW3D_FORMAT_UNKNOWN,
2211
2227
true );
2212
2228
return surface;
You can’t perform that action at this time.
0 commit comments