mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-06 04:05:11 +08:00
engine: client: make RefAPI's R_GetConfigName optional
This commit is contained in:
@@ -315,10 +315,15 @@ static screenfade_t *pfnRefGetScreenFade( void )
|
||||
|
||||
static qboolean R_Init_Video_( ref_graphic_apis_t type )
|
||||
{
|
||||
host.apply_opengl_config = true;
|
||||
Cbuf_AddTextf( "exec %s.cfg\n", ref.dllFuncs.R_GetConfigName());
|
||||
Cbuf_Execute();
|
||||
host.apply_opengl_config = false;
|
||||
const char *config_name = ref.dllFuncs.R_GetConfigName ? ref.dllFuncs.R_GetConfigName() : NULL;
|
||||
|
||||
if( config_name )
|
||||
{
|
||||
host.apply_opengl_config = true;
|
||||
Cbuf_AddTextf( "exec %s.cfg\n", config_name );
|
||||
Cbuf_Execute();
|
||||
host.apply_opengl_config = false;
|
||||
}
|
||||
|
||||
return R_Init_Video( type );
|
||||
}
|
||||
|
||||
@@ -1542,14 +1542,19 @@ save opengl variables into opengl.cfg
|
||||
*/
|
||||
void Host_WriteOpenGLConfig( void )
|
||||
{
|
||||
const char *config_name;
|
||||
string name;
|
||||
file_t *f;
|
||||
|
||||
if( Sys_CheckParm( "-nowriteconfig" ) )
|
||||
if( Sys_CheckParm( "-nowriteconfig" ) || !ref.dllFuncs.R_GetConfigName )
|
||||
return;
|
||||
|
||||
Q_snprintf( name, sizeof( name ), "%s.cfg", ref.dllFuncs.R_GetConfigName() );
|
||||
config_name = ref.dllFuncs.R_GetConfigName();
|
||||
|
||||
if( !config_name )
|
||||
return;
|
||||
|
||||
Q_snprintf( name, sizeof( name ), "%s.cfg", config_name );
|
||||
|
||||
f = FS_Open( va( "%s.new", name ), "w", false );
|
||||
if( f )
|
||||
|
||||
@@ -821,7 +821,6 @@ void SV_SendClientMessages( void )
|
||||
{
|
||||
sv_client_t *cl;
|
||||
int i;
|
||||
double updaterate_time;
|
||||
double time_until_next_message;
|
||||
|
||||
if( sv.state == ss_dead )
|
||||
|
||||
Reference in New Issue
Block a user