From a2e35eb774c75cafe448deafa243cef81b837238 Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 18 Aug 2023 17:50:42 +0600 Subject: [PATCH] in autocaulk use caulk instead of nodraw, if latter is nonsolid #145 --- tools/quake3/q3map2/bsp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/quake3/q3map2/bsp.cpp b/tools/quake3/q3map2/bsp.cpp index 653591f9..284ea3e0 100644 --- a/tools/quake3/q3map2/bsp.cpp +++ b/tools/quake3/q3map2/bsp.cpp @@ -46,6 +46,9 @@ static void autocaulk_write(){ ApplySurfaceParm( "slime", &fslime, NULL, NULL ); int flava = 0; ApplySurfaceParm( "lava", &flava, NULL, NULL ); + // many setups have nodraw shader nonsolid, including vQ3; and nondrawnonsolid also... fall back to caulk in such case + // it would be better to decide in Radiant, as it has configurable per game common shaders, but it has no solidity info + const bool nodraw_is_solid = ShaderInfoForShader( "textures/common/nodraw" )->compileFlags & C_SOLID; for ( const brush_t& b : entities[0].brushes ) { fprintf( file, "%i ", b.brushNum ); @@ -66,7 +69,7 @@ static void autocaulk_write(){ } else if( b.compileFlags & C_TRANSLUCENT ){ if( contentShader->compileFlags & C_SOLID ) - fprintf( file, "N" ); + fprintf( file, nodraw_is_solid? "N" : "c" ); else fprintf( file, "n" ); }