@@ -5039,11 +5039,15 @@ void RE_LoadWorldMap( const char *name )
50395039 // try will not look at the partially loaded version
50405040 tr.world = nullptr ;
50415041
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
50475051
50485052 s_worldData = {};
50495053 Q_strncpyz ( s_worldData.name , name, sizeof ( s_worldData.name ) );
@@ -5131,7 +5135,6 @@ void RE_LoadWorldMap( const char *name )
51315135 tr.worldLight = tr.lightMode ;
51325136 tr.modelLight = lightMode_t::FULLBRIGHT;
51335137 tr.modelDeluxe = deluxeMode_t::NONE;
5134- tr.mapLightFactor = tr.identityLight = 1 .0f ;
51355138
51365139 // Use fullbright lighting for everything if the world is fullbright.
51375140 if ( tr.worldLight != lightMode_t::FULLBRIGHT )
0 commit comments