Skip to content

Commit c6d6122

Browse files
committed
Change r_ambientScale to a new-style cvar
1 parent beccd92 commit c6d6122

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/engine/renderer/gl_shader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static std::string GenEngineConstants() {
599599
// Engine constants
600600
std::string str;
601601

602-
AddDefine( str, "r_AmbientScale", r_ambientScale->value );
602+
AddDefine( str, "r_AmbientScale", r_ambientScale.Get() );
603603
AddDefine( str, "r_SpecularScale", r_specularScale->value );
604604
AddDefine( str, "r_zNear", r_znear->value );
605605

src/engine/renderer/tr_bsp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4356,7 +4356,7 @@ void R_LoadEntities( lump_t *l, std::string &externalEntities )
43564356
sscanf( value, "%f %f %f", &tr.ambientLight[0], &tr.ambientLight[1],
43574357
&tr.ambientLight[2] );
43584358

4359-
VectorScale( tr.ambientLight, r_ambientScale->value, tr.ambientLight );
4359+
VectorScale( tr.ambientLight, r_ambientScale.Get(), tr.ambientLight );
43604360
tr.ambientLightSet = true;
43614361
}
43624362
}

src/engine/renderer/tr_init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
218218

219219
Cvar::Range<Cvar::Cvar<float>> r_forceAmbient( "r_forceAmbient", "Minimal light amount in lightGrid", Cvar::NONE,
220220
0.125f, 0.0f, 0.3f );
221-
cvar_t *r_ambientScale;
221+
Cvar::Cvar<float> r_ambientScale( "r_ambientScale", "Scale lightGrid produced by ambientColor keyword by this much", Cvar::CHEAT, 1.0 );
222222
cvar_t *r_lightScale;
223223
cvar_t *r_debugSort;
224224
cvar_t *r_printShaders;
@@ -1192,7 +1192,7 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
11921192
r_gamma = Cvar_Get( "r_gamma", "1.0", CVAR_ARCHIVE );
11931193
r_facePlaneCull = Cvar_Get( "r_facePlaneCull", "1", 0 );
11941194

1195-
r_ambientScale = Cvar_Get( "r_ambientScale", "1.0", CVAR_CHEAT | CVAR_LATCH );
1195+
Cvar::Latch( r_ambientScale );
11961196
r_lightScale = Cvar_Get( "r_lightScale", "2", CVAR_CHEAT );
11971197

11981198
r_vboFaces = Cvar_Get( "r_vboFaces", "1", CVAR_CHEAT );

src/engine/renderer/tr_local.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ enum class shaderProfilerRenderSubGroupsMode {
28912891
extern cvar_t *r_noFog;
28922892

28932893
extern Cvar::Range<Cvar::Cvar<float>> r_forceAmbient;
2894-
extern cvar_t *r_ambientScale;
2894+
extern Cvar::Cvar<float> r_ambientScale;
28952895
extern cvar_t *r_lightScale;
28962896

28972897
extern Cvar::Cvar<bool> r_drawSky; // Controls whether sky should be drawn or cleared.

0 commit comments

Comments
 (0)