@@ -193,7 +193,7 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, shaderStage_t* pStage,
193
193
194
194
// HeightMap
195
195
if ( pStage->enableReliefMapping ) {
196
- float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
196
+ float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
197
197
depthScale *= shader->reliefDepthScale ;
198
198
199
199
gl_lightMappingShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -209,8 +209,8 @@ void UpdateSurfaceDataLightMapping( uint32_t* materials, shaderStage_t* pStage,
209
209
}
210
210
211
211
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 () );
214
214
215
215
gl_lightMappingShaderMaterial->SetUniform_SpecularExponent ( specExpMin, specExpMax );
216
216
}
@@ -249,7 +249,7 @@ void UpdateSurfaceDataReflection( uint32_t* materials, shaderStage_t* pStage, bo
249
249
250
250
// u_depthScale u_reliefOffsetBias
251
251
if ( pStage->enableReliefMapping ) {
252
- float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
252
+ float depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
253
253
float reliefDepthScale = shader->reliefDepthScale ;
254
254
depthScale *= reliefDepthScale == 0 ? 1 : reliefDepthScale;
255
255
gl_reflectionShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -322,8 +322,8 @@ void UpdateSurfaceDataLiquid( uint32_t* materials, shaderStage_t* pStage, bool,
322
322
// NOTE: specular component is computed by shader.
323
323
// FIXME: physical mapping is not implemented.
324
324
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 () );
327
327
gl_liquidShaderMaterial->SetUniform_SpecularExponent ( specMin, specMax );
328
328
}
329
329
@@ -335,7 +335,7 @@ void UpdateSurfaceDataLiquid( uint32_t* materials, shaderStage_t* pStage, bool,
335
335
float depthScale;
336
336
float reliefDepthScale;
337
337
338
- depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale-> value );
338
+ depthScale = RB_EvalExpression ( &pStage->depthScaleExp , r_reliefDepthScale. Get () );
339
339
reliefDepthScale = tess.surfaceShader ->reliefDepthScale ;
340
340
depthScale *= reliefDepthScale == 0 ? 1 : reliefDepthScale;
341
341
gl_liquidShaderMaterial->SetUniform_ReliefDepthScale ( depthScale );
@@ -1407,10 +1407,10 @@ void MaterialSystem::ProcessStage( drawSurf_t* drawSurf, shaderStage_t* pStage,
1407
1407
* A material represents a distinct global OpenGL state (e. g. blend function, depth test, depth write etc.)
1408
1408
* Materials can have a dependency on other materials to make sure that consecutive stages are rendered in the proper order */
1409
1409
void 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 ) ;
1414
1414
generatingWorldCommandBuffer = true ;
1415
1415
1416
1416
Log::Debug ( " Generating world materials" );
@@ -1485,8 +1485,8 @@ void MaterialSystem::GenerateWorldMaterials() {
1485
1485
}
1486
1486
} */
1487
1487
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 ) ;
1490
1490
AddAllWorldSurfaces ();
1491
1491
1492
1492
GeneratePortalBoundingSpheres ();
@@ -1602,7 +1602,7 @@ void MaterialSystem::QueueSurfaceCull( const uint32_t viewID, const vec3_t origi
1602
1602
}
1603
1603
1604
1604
void MaterialSystem::DepthReduction () {
1605
- if ( r_lockpvs-> integer ) {
1605
+ if ( r_lockpvs. Get () ) {
1606
1606
if ( !PVSLocked ) {
1607
1607
lockedDepthImage = depthImage;
1608
1608
}
@@ -1709,11 +1709,11 @@ void MaterialSystem::CullSurfaces() {
1709
1709
}
1710
1710
1711
1711
if ( PVSLocked ) {
1712
- if ( r_lockpvs-> integer == 0 ) {
1712
+ if ( ! r_lockpvs. Get () ) {
1713
1713
PVSLocked = false ;
1714
1714
}
1715
1715
}
1716
- if ( r_lockpvs-> integer == 1 && !PVSLocked ) {
1716
+ if ( r_lockpvs. Get () && !PVSLocked ) {
1717
1717
PVSLocked = true ;
1718
1718
for ( int i = 0 ; i < 6 ; i++ ) {
1719
1719
VectorCopy ( frustum[0 ][i].normal , lockedFrustums[view][i].normal );
@@ -2005,7 +2005,7 @@ void MaterialSystem::AddPortalSurfaces() {
2005
2005
return ;
2006
2006
}
2007
2007
2008
- if ( r_lockpvs-> integer ) {
2008
+ if ( r_lockpvs. Get () ) {
2009
2009
return ;
2010
2010
}
2011
2011
@@ -2030,7 +2030,7 @@ void MaterialSystem::AddAutospriteSurfaces() {
2030
2030
}
2031
2031
2032
2032
void MaterialSystem::RenderMaterials ( const shaderSort_t fromSort, const shaderSort_t toSort, const uint32_t viewID ) {
2033
- if ( !r_drawworld-> integer ) {
2033
+ if ( !r_drawworld. Get () ) {
2034
2034
return ;
2035
2035
}
2036
2036
@@ -2126,7 +2126,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
2126
2126
}
2127
2127
2128
2128
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 ) ) {
2130
2130
return ;
2131
2131
}
2132
2132
}
@@ -2136,7 +2136,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
2136
2136
GL_State ( stateBits );
2137
2137
if ( material.usePolygonOffset ) {
2138
2138
glEnable ( GL_POLYGON_OFFSET_FILL );
2139
- GL_PolygonOffset ( r_offsetFactor-> value , r_offsetUnits-> value );
2139
+ GL_PolygonOffset ( r_offsetFactor. Get () , r_offsetUnits. Get () );
2140
2140
} else {
2141
2141
glDisable ( GL_POLYGON_OFFSET_FILL );
2142
2142
}
@@ -2278,7 +2278,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
2278
2278
RenderIndirect ( material, viewID );
2279
2279
}
2280
2280
2281
- if ( r_showTris-> integer
2281
+ if ( r_showTris. Get ()
2282
2282
&& ( material.stateBits & GLS_DEPTHMASK_TRUE ) == 0
2283
2283
&& ( material.shaderBinder == &BindShaderLightMapping || material.shaderBinder == &BindShaderGeneric3D ) )
2284
2284
{
0 commit comments