engine: move cvars that expected to exist by client.dll from render dll to engine

Fixes #316
This commit is contained in:
Alibek Omarov 2021-03-01 20:03:32 +03:00
parent fa555c1f09
commit 58edfbc485
5 changed files with 13 additions and 4 deletions

View File

@ -648,6 +648,11 @@ qboolean R_Init( void )
r_showtree = Cvar_Get( "r_showtree", "0", FCVAR_ARCHIVE, "build the graph of visible BSP tree" );
r_refdll = Cvar_Get( "r_refdll", "", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "choose renderer implementation, if supported" );
// cvars that are expected to exist by client.dll
// refdll should just get pointer to them
Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
// cvars are created, execute video config
Cbuf_AddText( "exec video.cfg" );
Cbuf_Execute();

View File

@ -842,7 +842,7 @@ void GL_InitCommands( void )
r_dynamic = gEngfuncs.Cvar_Get( "r_dynamic", "1", FCVAR_ARCHIVE, "allow dynamic lighting (dlights, lightstyles)" );
r_traceglow = gEngfuncs.Cvar_Get( "r_traceglow", "1", FCVAR_ARCHIVE, "cull flares behind models" );
r_lightmap = gEngfuncs.Cvar_Get( "r_lightmap", "0", FCVAR_CHEAT, "lightmap debugging tool" );
r_drawentities = gEngfuncs.Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
r_drawentities = gEngfuncs.pfnGetCvarPointer( "r_drawentities", 0 );
r_decals = gEngfuncs.pfnGetCvarPointer( "r_decals", 0 );
r_showhull = gEngfuncs.pfnGetCvarPointer( "r_showhull", 0 );

View File

@ -152,7 +152,9 @@ R_StudioInit
*/
void R_StudioInit( void )
{
cl_himodels = gEngfuncs.Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
// guaranteed to exist by engine
cl_himodels = gEngfuncs.pfnGetCvarPointer( "cl_himodels", 0 );
r_studio_sort_textures = gEngfuncs.Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
r_drawviewmodel = gEngfuncs.Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
r_studio_drawelements = gEngfuncs.Cvar_Get( "r_studio_drawelements", "1", FCVAR_ARCHIVE, "use glDrawElements for studiomodels" );

View File

@ -1930,7 +1930,7 @@ qboolean GAME_EXPORT R_Init( void )
gl_emboss_scale = gEngfuncs.Cvar_Get( "gl_emboss_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "fake bumpmapping scale" );
vid_gamma = gEngfuncs.pfnGetCvarPointer( "gamma", 0 );
r_norefresh = gEngfuncs.Cvar_Get( "r_norefresh", "0", 0, "disable 3D rendering (use with caution)" );
r_drawentities = gEngfuncs.Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
r_drawentities = gEngfuncs.pfnGetCvarPointer( "r_drawentities", 0 );
vid_brightness = gEngfuncs.pfnGetCvarPointer( "brightness", 0 );
r_fullbright = gEngfuncs.Cvar_Get( "r_fullbright", "0", FCVAR_CHEAT, "disable lightmaps, get fullbright for entities" );

View File

@ -149,11 +149,13 @@ R_StudioInit
*/
void R_StudioInit( void )
{
cl_himodels = gEngfuncs.Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
r_studio_sort_textures = gEngfuncs.Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
r_drawviewmodel = gEngfuncs.Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
r_studio_drawelements = gEngfuncs.Cvar_Get( "r_studio_drawelements", "1", FCVAR_ARCHIVE, "use glDrawElements for studiomodels" );
// guaranteed to exist by engine
cl_himodels = gEngfuncs.pfnGetCvarPointer( "cl_himodels", 0 );
Matrix3x4_LoadIdentity( g_studio.rotationmatrix );
r_glowshellfreq = gEngfuncs.Cvar_Get( "r_glowshellfreq", "2.2", 0, "glowing shell frequency update" );