2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00

Remove DEFAULT_(ACCELERATED|SOFTWARE)_RENDERER

This is no longer needed as we now use DEFAULT_RENDERERS order priority
and only try to load the detected renderers.
This commit is contained in:
Gleb Mazovetskiy 2021-01-02 23:16:48 +00:00 committed by Alibek Omarov
parent 5e0a0765ce
commit a234888d44
2 changed files with 13 additions and 21 deletions

View File

@ -192,16 +192,4 @@ Default build-depended cvar and constant values
#define DEFAULT_FULLSCREEN 1
#endif // DEFAULT_FULLSCREEN
#ifndef DEFAULT_ACCELERATED_RENDERER
#if XASH_MOBILE_PLATFORM
#define DEFAULT_ACCELERATED_RENDERER "gles1"
#else // !XASH_MOBILE_PLATFORM
#define DEFAULT_ACCELERATED_RENDERER "gl"
#endif // !XASH_MOBILE_PLATFORM
#endif // DEFAULT_ACCELERATED_RENDERER
#ifndef DEFAULT_SOFTWARE_RENDERER
#define DEFAULT_SOFTWARE_RENDERER "soft" // mittorn's ref_soft
#endif // DEFAULT_SOFTWARE_RENDERER
#endif // DEFAULTS_H

View File

@ -637,7 +637,7 @@ void R_CollectRendererNames( void )
qboolean R_Init( void )
{
qboolean success = false;
string refopt;
string requested;
gl_vsync = Cvar_Get( "gl_vsync", "0", FCVAR_ARCHIVE, "enable vertical syncronization" );
gl_showtextures = Cvar_Get( "r_showtextures", "0", FCVAR_CHEAT, "show all uploaded textures" );
@ -659,15 +659,19 @@ qboolean R_Init( void )
R_CollectRendererNames();
// command line have priority
if( !Sys_GetParmFromCmdLine( "-ref", refopt ) )
{
// Priority:
// 1. Command line `-ref` argument.
// 2. `ref_dll` cvar.
// 3. Detected renderers in `DEFAULT_RENDERERS` order.
requested[0] = '\0';
if( !Sys_GetParmFromCmdLine( "-ref", requested ) && COM_CheckString( r_refdll->string ) )
// r_refdll is set to empty by default, so we can change hardcoded defaults just in case
Q_strncpy( refopt, COM_CheckString( r_refdll->string ) ?
r_refdll->string : DEFAULT_ACCELERATED_RENDERER, sizeof( refopt ) );
}
Q_strncpy( requested, r_refdll->string, sizeof( requested ) );
if( !(success = R_LoadRenderer( refopt )))
if ( requested[0] )
success = R_LoadRenderer( requested );
if( !success )
{
int i;
@ -675,7 +679,7 @@ qboolean R_Init( void )
for( i = 0; i < ref.numRenderers; i++ )
{
// skip renderer that was requested but failed to load
if( Q_strcmp( refopt, ref.shortNames[i] ))
if( !Q_strcmp( requested, ref.shortNames[i] ) )
continue;
success = R_LoadRenderer( ref.shortNames[i] );