mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: additionally look for loading images with bmp and png extensions
This commit is contained in:
@@ -814,20 +814,33 @@ INTERNAL RESOURCE
|
||||
*/
|
||||
void SCR_RegisterTextures( void )
|
||||
{
|
||||
// register gfx.wad images
|
||||
if( FS_FileExists( "gfx/lambda.lmp", false ))
|
||||
const char *exts[] = { "lmp", "bmp", "png" };
|
||||
const char *names[] = { "gfx/lambda", "gfx/loading" };
|
||||
uint flags = TF_IMAGE|TF_ALLOW_NEAREST;
|
||||
|
||||
if( cl_allow_levelshots.value )
|
||||
SetBits( flags, TF_LUMINANCE );
|
||||
|
||||
for( int i = 0; i < ARRAYSIZE( names ); i++ )
|
||||
{
|
||||
if( cl_allow_levelshots.value )
|
||||
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE|TF_ALLOW_NEAREST );
|
||||
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
|
||||
}
|
||||
else if( FS_FileExists( "gfx/loading.lmp", false ))
|
||||
{
|
||||
if( cl_allow_levelshots.value )
|
||||
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE|TF_ALLOW_NEAREST );
|
||||
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
|
||||
for( int j = 0; j < ARRAYSIZE( exts ); j++ )
|
||||
{
|
||||
string path;
|
||||
|
||||
if( Q_snprintf( path, sizeof( path ), "%s.%s", names[i], exts[j] ) < 0 )
|
||||
continue;
|
||||
|
||||
if( !FS_FileExists( path, false ))
|
||||
continue;
|
||||
|
||||
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( path, NULL, 0, flags );
|
||||
|
||||
if( cls.loadingBar )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Con_Printf( S_WARN "%s: failed to load loading image\n", __func__ );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user