mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
engine: ref: try to bruteforce all available renderers if we're failed to load requested one
This commit is contained in:
parent
5b8d504817
commit
766ef84af4
@ -669,17 +669,20 @@ qboolean R_Init( void )
|
|||||||
|
|
||||||
if( !(success = R_LoadRenderer( refopt )))
|
if( !(success = R_LoadRenderer( refopt )))
|
||||||
{
|
{
|
||||||
// check if we are tried to load default accelearated renderer already
|
int i;
|
||||||
// and if not, load it first
|
|
||||||
if( Q_strcmp( refopt, DEFAULT_ACCELERATED_RENDERER ) )
|
|
||||||
{
|
|
||||||
success = R_LoadRenderer( refopt );
|
|
||||||
}
|
|
||||||
|
|
||||||
// software renderer is the last chance...
|
// cycle through renderers that we collected in CollectRendererNames
|
||||||
if( !success )
|
for( i = 0; i < ref.numRenderers; i++ )
|
||||||
{
|
{
|
||||||
success = R_LoadRenderer( DEFAULT_SOFTWARE_RENDERER );
|
// skip renderer that was requested but failed to load
|
||||||
|
if( Q_strcmp( refopt, ref.shortNames[i] ))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
success = R_LoadRenderer( ref.shortNames[i] );
|
||||||
|
|
||||||
|
// yay, found working one
|
||||||
|
if( success )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ GNU General Public License for more details.
|
|||||||
|
|
||||||
#define XASH_ENGINE_NAME "Xash3D FWGS"
|
#define XASH_ENGINE_NAME "Xash3D FWGS"
|
||||||
|
|
||||||
|
// renderers order is important, software is always a last chance fallback
|
||||||
#define DEFAULT_RENDERERS { "gl", "gles1", "gles2", "gl4es", "soft" }
|
#define DEFAULT_RENDERERS { "gl", "gles1", "gles2", "gl4es", "soft" }
|
||||||
#define DEFAULT_RENDERERS_LEN 5
|
#define DEFAULT_RENDERERS_LEN 5
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user