Browse Source

engine: allow ref dlls to use convar_t

pull/2/head
Alibek Omarov 2 years ago
parent
commit
70b26a13c2
  1. 2
      engine/client/ref_common.c
  2. 2
      engine/common/cvar.h
  3. 4
      engine/ref_api.h

2
engine/client/ref_common.c

@ -231,7 +231,7 @@ static ref_api_t gEngfuncs = @@ -231,7 +231,7 @@ static ref_api_t gEngfuncs =
Cvar_VariableString,
Cvar_SetValue,
Cvar_Set,
(void*)Cvar_RegisterVariable,
Cvar_RegisterVariable,
Cvar_FullSet,
Cmd_AddRefCommand,

2
engine/common/cvar.h

@ -58,6 +58,7 @@ typedef struct convar_s @@ -58,6 +58,7 @@ typedef struct convar_s
#define CVAR_TO_BOOL( x ) ((x) && ((x)->value != 0.0f) ? true : false )
#ifndef REF_DLL
cvar_t *Cvar_GetList( void );
#define Cvar_FindVar( name ) Cvar_FindVarExt( name, 0 )
convar_t *Cvar_FindVarExt( const char *var_name, int ignore_group );
@ -81,5 +82,6 @@ qboolean Cvar_CommandWithPrivilegeCheck( convar_t *v, qboolean isPrivileged ); @@ -81,5 +82,6 @@ qboolean Cvar_CommandWithPrivilegeCheck( convar_t *v, qboolean isPrivileged );
void Cvar_Init( void );
void Cvar_PostFSInit( void );
void Cvar_Unlink( int group );
#endif // REF_DLL
#endif//CVAR_H

4
engine/ref_api.h

@ -238,6 +238,7 @@ typedef struct remap_info_s @@ -238,6 +238,7 @@ typedef struct remap_info_s
model_t *model; // for catch model changes
} remap_info_t;
typedef struct convar_s convar_t;
struct con_nprint_s;
struct engine_studio_api_s;
struct r_studio_interface_s;
@ -270,7 +271,7 @@ typedef struct ref_api_s @@ -270,7 +271,7 @@ typedef struct ref_api_s
const char *(*pfnGetCvarString)( const char *szName );
void (*Cvar_SetValue)( const char *name, float value );
void (*Cvar_Set)( const char *name, const char *value );
void (*Cvar_RegisterVariable)( cvar_t *var );
void (*Cvar_RegisterVariable)( convar_t *var );
void (*Cvar_FullSet)( const char *var_name, const char *value, int flags );
// command handlers
@ -659,6 +660,7 @@ typedef int (*REFAPI)( int version, ref_interface_t *pFunctionTable, ref_api_t* @@ -659,6 +660,7 @@ typedef int (*REFAPI)( int version, ref_interface_t *pFunctionTable, ref_api_t*
ENGINE_SHARED_CVAR( f, r_sprite_lighting ) \
ENGINE_SHARED_CVAR( f, r_drawviewmodel ) \
ENGINE_SHARED_CVAR( f, r_glowshellfreq ) \
ENGINE_SHARED_CVAR( f, r_lighting_modulate ) \
#define DECLARE_ENGINE_SHARED_CVAR_LIST() \
ENGINE_SHARED_CVAR_LIST( DECLARE_ENGINE_SHARED_CVAR )

Loading…
Cancel
Save