don't write nomipmaps hack 5daf2e265e when native external lightmaps, as it prevents r_mapOverbrightBits application

This commit is contained in:
Garux 2024-04-05 14:45:42 +05:00
parent b0a065afd6
commit d59668f943

View File

@ -1789,8 +1789,9 @@ static void WriteBSPFileAfterLight( const char *bspFileName ){
const auto lmPathStart = String64( "maps/", mapName, '/' ); const auto lmPathStart = String64( "maps/", mapName, '/' );
std::set<int> lmIds; std::set<int> lmIds;
// find external lm ids, if any // find external lm ids, if any
// stupidly search in shader text, ( numExtLightmaps > 0 && !externalLightmaps ) check wont work in e.g. // stupidly search in shader text, ( numExtLightmaps > 0 ) check wont work when e.g. deluxemaps
// ET with externalLightmaps + lightstyles hack or potentially with deluxemaps // also would excessively include lightstyles using $lightmap reference
if( !externalLightmaps ){ // unless native ext lms: e.g. in ET with lightstyles hack preloading lm imgs breaks r_mapOverbrightBits
for ( const shaderInfo_t& si : Span( shaderInfo, numShaderInfo ) ) for ( const shaderInfo_t& si : Span( shaderInfo, numShaderInfo ) )
{ {
if ( si.custom && !strEmptyOrNull( si.shaderText ) ) { if ( si.custom && !strEmptyOrNull( si.shaderText ) ) {
@ -1805,6 +1806,7 @@ static void WriteBSPFileAfterLight( const char *bspFileName ){
} }
} }
} }
}
if( !lmIds.empty() || trisoup ){ if( !lmIds.empty() || trisoup ){
std::vector<bspModel_t> bakModels; std::vector<bspModel_t> bakModels;