@@ -5039,11 +5039,15 @@ void RE_LoadWorldMap( const char *name )
5039
5039
// try will not look at the partially loaded version
5040
5040
tr.world = nullptr ;
5041
5041
5042
- // tr.worldDeluxeMapping will be set by R_LoadLightmaps()
5043
- tr.worldLightMapping = false ;
5044
- // tr.worldDeluxeMapping will be set by R_LoadEntities()
5045
- tr.worldDeluxeMapping = false ;
5046
- tr.worldHDR_RGBE = false ;
5042
+ // It's probably a mistake if any of these lighting parameters are actually
5043
+ // used before a map is loaded.
5044
+ tr.worldLightMapping = false ; // set by R_LoadLightmaps
5045
+ tr.worldDeluxeMapping = false ; // set by R_LoadEntities
5046
+ tr.worldHDR_RGBE = false ; // set by R_LoadEntities
5047
+ tr.mapOverBrightBits = r_overbrightDefaultExponent.Get (); // maybe set by R_LoadEntities
5048
+ tr.overbrightBits = std::min ( tr.mapOverBrightBits , r_overbrightBits.Get () ); // set by RE_LoadWorldMap
5049
+ tr.mapLightFactor = 1 .0f ; // set by RE_LoadWorldMap
5050
+ tr.identityLight = 1 .0f ; // set by RE_LoadWorldMap
5047
5051
5048
5052
s_worldData = {};
5049
5053
Q_strncpyz ( s_worldData.name , name, sizeof ( s_worldData.name ) );
@@ -5131,7 +5135,6 @@ void RE_LoadWorldMap( const char *name )
5131
5135
tr.worldLight = tr.lightMode ;
5132
5136
tr.modelLight = lightMode_t::FULLBRIGHT;
5133
5137
tr.modelDeluxe = deluxeMode_t::NONE;
5134
- tr.mapLightFactor = tr.identityLight = 1 .0f ;
5135
5138
5136
5139
// Use fullbright lighting for everything if the world is fullbright.
5137
5140
if ( tr.worldLight != lightMode_t::FULLBRIGHT )
0 commit comments