@@ -5060,11 +5060,15 @@ void RE_LoadWorldMap( const char *name )
5060
5060
// try will not look at the partially loaded version
5061
5061
tr.world = nullptr ;
5062
5062
5063
- // tr.worldDeluxeMapping will be set by R_LoadLightmaps()
5064
- tr.worldLightMapping = false ;
5065
- // tr.worldDeluxeMapping will be set by R_LoadEntities()
5066
- tr.worldDeluxeMapping = false ;
5067
- tr.worldHDR_RGBE = false ;
5063
+ // It's probably a mistake if any of these lighting parameters are actually
5064
+ // used before a map is loaded.
5065
+ tr.worldLightMapping = false ; // set by R_LoadLightmaps
5066
+ tr.worldDeluxeMapping = false ; // set by R_LoadEntities
5067
+ tr.worldHDR_RGBE = false ; // set by R_LoadEntities
5068
+ tr.mapOverBrightBits = r_overbrightDefaultExponent.Get (); // maybe set by R_LoadEntities
5069
+ tr.overbrightBits = std::min ( tr.mapOverBrightBits , r_overbrightBits.Get () ); // set by RE_LoadWorldMap
5070
+ tr.mapLightFactor = 1 .0f ; // set by RE_LoadWorldMap
5071
+ tr.identityLight = 1 .0f ; // set by RE_LoadWorldMap
5068
5072
5069
5073
s_worldData = {};
5070
5074
Q_strncpyz ( s_worldData.name , name, sizeof ( s_worldData.name ) );
@@ -5152,7 +5156,6 @@ void RE_LoadWorldMap( const char *name )
5152
5156
tr.worldLight = tr.lightMode ;
5153
5157
tr.modelLight = lightMode_t::FULLBRIGHT;
5154
5158
tr.modelDeluxe = deluxeMode_t::NONE;
5155
- tr.mapLightFactor = tr.identityLight = 1 .0f ;
5156
5159
5157
5160
// Use fullbright lighting for everything if the world is fullbright.
5158
5161
if ( tr.worldLight != lightMode_t::FULLBRIGHT )
0 commit comments