@@ -5027,11 +5027,15 @@ void RE_LoadWorldMap( const char *name )
5027
5027
// try will not look at the partially loaded version
5028
5028
tr.world = nullptr ;
5029
5029
5030
- // tr.worldDeluxeMapping will be set by R_LoadLightmaps()
5031
- tr.worldLightMapping = false ;
5032
- // tr.worldDeluxeMapping will be set by R_LoadEntities()
5033
- tr.worldDeluxeMapping = false ;
5034
- tr.worldHDR_RGBE = false ;
5030
+ // It's probably a mistake if any of these lighting parameters are actually
5031
+ // used before a map is loaded.
5032
+ tr.worldLightMapping = false ; // set by R_LoadLightmaps
5033
+ tr.worldDeluxeMapping = false ; // set by R_LoadEntities
5034
+ tr.worldHDR_RGBE = false ; // set by R_LoadEntities
5035
+ tr.mapOverBrightBits = r_overbrightDefaultExponent.Get (); // maybe set by R_LoadEntities
5036
+ tr.overbrightBits = std::min ( tr.mapOverBrightBits , r_overbrightBits.Get () ); // set by RE_LoadWorldMap
5037
+ tr.mapLightFactor = 1 .0f ; // set by RE_LoadWorldMap
5038
+ tr.identityLight = 1 .0f ; // set by RE_LoadWorldMap
5035
5039
5036
5040
s_worldData = {};
5037
5041
Q_strncpyz ( s_worldData.name , name, sizeof ( s_worldData.name ) );
@@ -5119,7 +5123,6 @@ void RE_LoadWorldMap( const char *name )
5119
5123
tr.worldLight = tr.lightMode ;
5120
5124
tr.modelLight = lightMode_t::FULLBRIGHT;
5121
5125
tr.modelDeluxe = deluxeMode_t::NONE;
5122
- tr.mapLightFactor = tr.identityLight = 1 .0f ;
5123
5126
5124
5127
// Use fullbright lighting for everything if the world is fullbright.
5125
5128
if ( tr.worldLight != lightMode_t::FULLBRIGHT )
0 commit comments