Browse Source

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.
pull/2/head
Gleb Mazovetskiy 4 years ago committed by Alibek Omarov
parent
commit
a234888d44
  1. 12
      common/defaults.h
  2. 22
      engine/client/ref_common.c

12
common/defaults.h

@ -192,16 +192,4 @@ Default build-depended cvar and constant values @@ -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

22
engine/client/ref_common.c

@ -637,7 +637,7 @@ void R_CollectRendererNames( void ) @@ -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 ) @@ -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 ) @@ -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] );

Loading…
Cancel
Save