engine: client: additionally look for loading images with bmp and png extensions

This commit is contained in:
Alibek Omarov
2025-11-13 22:01:55 +05:00
parent 2e5d2c1dcc
commit 747baa1e16

View File

@@ -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__ );
}
/*