mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-22 03:41:39 +00:00
Failure to load PCX/BMP/TGA should not result in a fatal error. Check the existence of these files first, if the file does not exist, simply return. This way we'll still blow up on malformed images, which is less annoying.
This commit is contained in:
parent
217e3b51ad
commit
409f1fc026
2 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,7 @@ extern _QERFileSystemTable g_FileSystemTable;
|
||||||
void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height );
|
void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height );
|
||||||
|
|
||||||
#define Error g_FuncTable.m_pfnError
|
#define Error g_FuncTable.m_pfnError
|
||||||
|
#define vfsGetFileCount g_FileSystemTable.m_pfnGetFileCount
|
||||||
#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile
|
#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile
|
||||||
#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile
|
#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile
|
||||||
|
|
||||||
|
|
|
@ -743,6 +743,10 @@ void LoadImage( const char *name, byte ** pic, int *width, int *height ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( vfsGetFileCount( name, 0 ) == 0 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !g_ascii_strcasecmp( name + len - 4, ".tga" ) ) {
|
if ( !g_ascii_strcasecmp( name + len - 4, ".tga" ) ) {
|
||||||
LoadTGA( name, pic, width, height );
|
LoadTGA( name, pic, width, height );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue