mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-13 07:57:23 +00:00
Do not retry image loader for image that failed, patch by Zack Middleton (#4968)
This commit is contained in:
parent
c5e2654b54
commit
bd9485f597
1 changed files with 8 additions and 3 deletions
|
@ -860,8 +860,7 @@ static imageExtToLoaderMap_t imageLoaders[ ] =
|
||||||
{ "bmp", R_LoadBMP }
|
{ "bmp", R_LoadBMP }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int numImageLoaders = sizeof( imageLoaders ) /
|
static int numImageLoaders = ARRAY_LEN( imageLoaders );
|
||||||
sizeof( imageLoaders[ 0 ] );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
|
@ -874,9 +873,11 @@ Loads any of the supported image types into a cannonical
|
||||||
void R_LoadImage( const char *name, byte **pic, int *width, int *height )
|
void R_LoadImage( const char *name, byte **pic, int *width, int *height )
|
||||||
{
|
{
|
||||||
qboolean orgNameFailed = qfalse;
|
qboolean orgNameFailed = qfalse;
|
||||||
|
int orgLoader = -1;
|
||||||
int i;
|
int i;
|
||||||
char localName[ MAX_QPATH ];
|
char localName[ MAX_QPATH ];
|
||||||
const char *ext;
|
const char *ext;
|
||||||
|
char *altName;
|
||||||
|
|
||||||
*pic = NULL;
|
*pic = NULL;
|
||||||
*width = 0;
|
*width = 0;
|
||||||
|
@ -907,6 +908,7 @@ void R_LoadImage( const char *name, byte **pic, int *width, int *height )
|
||||||
// Loader failed, most likely because the file isn't there;
|
// Loader failed, most likely because the file isn't there;
|
||||||
// try again without the extension
|
// try again without the extension
|
||||||
orgNameFailed = qtrue;
|
orgNameFailed = qtrue;
|
||||||
|
orgLoader = i;
|
||||||
COM_StripExtension( name, localName, MAX_QPATH );
|
COM_StripExtension( name, localName, MAX_QPATH );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -921,7 +923,10 @@ void R_LoadImage( const char *name, byte **pic, int *width, int *height )
|
||||||
// the image formats supported
|
// the image formats supported
|
||||||
for( i = 0; i < numImageLoaders; i++ )
|
for( i = 0; i < numImageLoaders; i++ )
|
||||||
{
|
{
|
||||||
char *altName = va( "%s.%s", localName, imageLoaders[ i ].ext );
|
if (i == orgLoader)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
altName = va( "%s.%s", localName, imageLoaders[ i ].ext );
|
||||||
|
|
||||||
// Load
|
// Load
|
||||||
imageLoaders[ i ].ImageLoader( altName, pic, width, height );
|
imageLoaders[ i ].ImageLoader( altName, pic, width, height );
|
||||||
|
|
Loading…
Reference in a new issue