Skip to content

Commit

Permalink
Use -1 for map-value in r_forceAmbient
Browse files Browse the repository at this point in the history
Allow using 0 as an actual value.
  • Loading branch information
VReaperV committed Jan 26, 2025
1 parent cb5aca6 commit 959edd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/engine/renderer/tr_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4353,7 +4353,7 @@ void R_LoadEntities( lump_t *l, std::string &externalEntities )
// check for ambient color
else if ( !Q_stricmp( keyname, "_color" ) || !Q_stricmp( keyname, "ambientColor" ) )
{
if ( r_forceAmbient.Get() == 0 ) {
if ( r_forceAmbient.Get() == -1 ) {
sscanf( value, "%f %f %f", &tr.ambientLight[0], &tr.ambientLight[1],
&tr.ambientLight[2] );

Expand Down
4 changes: 2 additions & 2 deletions src/engine/renderer/tr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cvar_t *r_wolfFog;
cvar_t *r_noFog;

Cvar::Range<Cvar::Cvar<float>> r_forceAmbient( "r_forceAmbient", "Minimal light amount in lightGrid", Cvar::NONE,
0.125f, 0.0f, 0.3f );
Cvar::Range<Cvar::Cvar<float>> r_forceAmbient( "r_forceAmbient", "Minimal light amount in lightGrid; -1 to use map value", Cvar::NONE,
0.125f, -1.0f, 0.3f );
Cvar::Cvar<float> r_ambientScale( "r_ambientScale", "Scale lightGrid produced by ambientColor keyword by this much", Cvar::CHEAT, 1.0 );
cvar_t *r_lightScale;
cvar_t *r_debugSort;
Expand Down

0 comments on commit 959edd9

Please sign in to comment.