don't write nomipmaps hack 5daf2e265e when native external lightmaps, as it prevents r_mapOverbrightBits application
This commit is contained in:
parent
b0a065afd6
commit
d59668f943
|
|
@ -1789,18 +1789,20 @@ 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
|
||||||
for ( const shaderInfo_t& si : Span( shaderInfo, numShaderInfo ) )
|
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 ) )
|
||||||
if ( si.custom && !strEmptyOrNull( si.shaderText ) ) {
|
{
|
||||||
const char *txt = si.shaderText;
|
if ( si.custom && !strEmptyOrNull( si.shaderText ) ) {
|
||||||
while( ( txt = strstr( txt, lmPathStart ) ) ){
|
const char *txt = si.shaderText;
|
||||||
txt += strlen( lmPathStart );
|
while( ( txt = strstr( txt, lmPathStart ) ) ){
|
||||||
int lmindex;
|
txt += strlen( lmPathStart );
|
||||||
int okcount = 0;
|
int lmindex;
|
||||||
if( sscanf( txt, EXTERNAL_LIGHTMAP "%n", &lmindex, &okcount ) && okcount == strlen( EXTERNAL_LIGHTMAP ) ){
|
int okcount = 0;
|
||||||
lmIds.insert( lmindex );
|
if( sscanf( txt, EXTERNAL_LIGHTMAP "%n", &lmindex, &okcount ) && okcount == strlen( EXTERNAL_LIGHTMAP ) ){
|
||||||
|
lmIds.insert( lmindex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user