@@ -193,7 +193,7 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, shaderStage_t* pStage,
193193
194194 // HeightMap
195195 if ( pStage->enableReliefMapping ) {
196- float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
196+ float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
197197 depthScale *= shader->reliefDepthScale ;
198198
199199 gl_lightMappingShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -209,8 +209,8 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, shaderStage_t* pStage,
209209 }
210210
211211 if ( pStage->enableSpecularMapping ) {
212- float specExpMin = RB_EvalExpression ( &pStage->specularExponentMin , r_specularExponentMin-> value );
213- float specExpMax = RB_EvalExpression ( &pStage->specularExponentMax , r_specularExponentMax-> value );
212+ float specExpMin = RB_EvalExpression ( &pStage->specularExponentMin , r_specularExponentMin. Get () );
213+ float specExpMax = RB_EvalExpression ( &pStage->specularExponentMax , r_specularExponentMax. Get () );
214214
215215 gl_lightMappingShaderMaterial->SetUniform_SpecularExponent ( specExpMin, specExpMax );
216216 }
@@ -249,7 +249,7 @@ void UpdateSurfaceDataReflection( uint32_t* materials, shaderStage_t* pStage, bo
249249
250250 // u_depthScale u_reliefOffsetBias
251251 if ( pStage->enableReliefMapping ) {
252- float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
252+ float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
253253 float reliefDepthScale = shader->reliefDepthScale ;
254254 depthScale *= reliefDepthScale == 0 ? 1 : reliefDepthScale;
255255 gl_reflectionShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -322,8 +322,8 @@ void UpdateSurfaceDataLiquid( uint32_t* materials, shaderStage_t* pStage, bool,
322322 // NOTE: specular component is computed by shader.
323323 // FIXME: physical mapping is not implemented.
324324 if ( pStage->enableSpecularMapping ) {
325- float specMin = RB_EvalExpression ( &pStage->specularExponentMin , r_specularExponentMin-> value );
326- float specMax = RB_EvalExpression ( &pStage->specularExponentMax , r_specularExponentMax-> value );
325+ float specMin = RB_EvalExpression ( &pStage->specularExponentMin , r_specularExponentMin. Get () );
326+ float specMax = RB_EvalExpression ( &pStage->specularExponentMax , r_specularExponentMax. Get () );
327327 gl_liquidShaderMaterial->SetUniform_SpecularExponent ( specMin, specMax );
328328 }
329329
@@ -335,7 +335,7 @@ void UpdateSurfaceDataLiquid( uint32_t* materials, shaderStage_t* pStage, bool,
335335 float depthScale;
336336 float reliefDepthScale;
337337
338- depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
338+ depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
339339 reliefDepthScale = tess.surfaceShader ->reliefDepthScale ;
340340 depthScale *= reliefDepthScale == 0 ? 1 : reliefDepthScale;
341341 gl_liquidShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -1407,10 +1407,10 @@ void MaterialSystem::ProcessStage( drawSurf_t* drawSurf, shaderStage_t* pStage,
14071407* A material represents a distinct global OpenGL state (e. g. blend function, depth test, depth write etc.)
14081408* Materials can have a dependency on other materials to make sure that consecutive stages are rendered in the proper order */
14091409void MaterialSystem::GenerateWorldMaterials () {
1410- const int current_r_nocull = r_nocull-> integer ;
1411- const int current_r_drawworld = r_drawworld-> integer ;
1412- r_nocull-> integer = 1 ;
1413- r_drawworld-> integer = 1 ;
1410+ const bool current_r_nocull = r_nocull. Get () ;
1411+ const bool current_r_drawworld = r_drawworld. Get () ;
1412+ r_nocull. Set ( true ) ;
1413+ r_drawworld. Set ( true ) ;
14141414 generatingWorldCommandBuffer = true ;
14151415
14161416 Log::Debug ( " Generating world materials" );
@@ -1485,8 +1485,8 @@ void MaterialSystem::GenerateWorldMaterials() {
14851485 }
14861486 } */
14871487
1488- r_nocull-> integer = current_r_nocull;
1489- r_drawworld-> integer = current_r_drawworld;
1488+ r_nocull. Set ( current_r_nocull ) ;
1489+ r_drawworld. Set ( current_r_drawworld ) ;
14901490 AddAllWorldSurfaces ();
14911491
14921492 GeneratePortalBoundingSpheres ();
@@ -1602,7 +1602,7 @@ void MaterialSystem::QueueSurfaceCull( const uint32_t viewID, const vec3_t origi
16021602}
16031603
16041604void MaterialSystem::DepthReduction () {
1605- if ( r_lockpvs-> integer ) {
1605+ if ( r_lockpvs. Get () ) {
16061606 if ( !PVSLocked ) {
16071607 lockedDepthImage = depthImage;
16081608 }
@@ -1709,11 +1709,11 @@ void MaterialSystem::CullSurfaces() {
17091709 }
17101710
17111711 if ( PVSLocked ) {
1712- if ( r_lockpvs-> integer == 0 ) {
1712+ if ( ! r_lockpvs. Get () ) {
17131713 PVSLocked = false ;
17141714 }
17151715 }
1716- if ( r_lockpvs-> integer == 1 && !PVSLocked ) {
1716+ if ( r_lockpvs. Get () && !PVSLocked ) {
17171717 PVSLocked = true ;
17181718 for ( int i = 0 ; i < 6 ; i++ ) {
17191719 VectorCopy ( frustum[0 ][i].normal , lockedFrustums[view][i].normal );
@@ -2005,7 +2005,7 @@ void MaterialSystem::AddPortalSurfaces() {
20052005 return ;
20062006 }
20072007
2008- if ( r_lockpvs-> integer ) {
2008+ if ( r_lockpvs. Get () ) {
20092009 return ;
20102010 }
20112011
@@ -2030,7 +2030,7 @@ void MaterialSystem::AddAutospriteSurfaces() {
20302030}
20312031
20322032void MaterialSystem::RenderMaterials ( const shaderSort_t fromSort, const shaderSort_t toSort, const uint32_t viewID ) {
2033- if ( !r_drawworld-> integer ) {
2033+ if ( !r_drawworld. Get () ) {
20342034 return ;
20352035 }
20362036
@@ -2126,7 +2126,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
21262126 }
21272127
21282128 if ( material.shaderBinder == BindShaderFog ) {
2129- if ( r_noFog-> integer || !r_wolfFog-> integer || ( backEnd.refdef .rdflags & RDF_NOWORLDMODEL ) ) {
2129+ if ( r_noFog. Get () || !r_wolfFog. Get () || ( backEnd.refdef .rdflags & RDF_NOWORLDMODEL ) ) {
21302130 return ;
21312131 }
21322132 }
@@ -2136,7 +2136,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
21362136 GL_State ( stateBits );
21372137 if ( material.usePolygonOffset ) {
21382138 glEnable ( GL_POLYGON_OFFSET_FILL );
2139- GL_PolygonOffset ( r_offsetFactor-> value , r_offsetUnits-> value );
2139+ GL_PolygonOffset ( r_offsetFactor. Get () , r_offsetUnits. Get () );
21402140 } else {
21412141 glDisable ( GL_POLYGON_OFFSET_FILL );
21422142 }
@@ -2278,7 +2278,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
22782278 RenderIndirect ( material, viewID );
22792279 }
22802280
2281- if ( r_showTris-> integer
2281+ if ( r_showTris. Get ()
22822282 && ( material.stateBits & GLS_DEPTHMASK_TRUE ) == 0
22832283 && ( material.shaderBinder == &BindShaderLightMapping || material.shaderBinder == &BindShaderGeneric3D ) )
22842284 {
0 commit comments