Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions tools/quake3/q3map2/nav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,38 @@ static void AddTri( std::vector<float> &verts, std::vector<int> &tris, vec3_t v1
static void LoadBrushTris( std::vector<float> &verts, std::vector<int> &tris ) {
int j;

int solidFlags = 0;
int temp = 0;
int surfaceSkip = 0;

char surfaceparm[16];

int defaultFlag = 0;
strcpy( surfaceparm, "default" );
ApplySurfaceParm( surfaceparm, &solidFlags, NULL, NULL );
ApplySurfaceParm( surfaceparm, &defaultFlag, NULL, NULL );

int playerclipFlag = 0;
strcpy( surfaceparm, "playerclip" );
ApplySurfaceParm( surfaceparm, &temp, NULL, NULL );
solidFlags |= temp;
ApplySurfaceParm( surfaceparm, &playerclipFlag, NULL, NULL );

int nodropFlag = 0;
strcpy( surfaceparm, "nodrop" );
ApplySurfaceParm( surfaceparm, &nodropFlag, NULL, NULL );

int lavaFlag = 0;
strcpy( surfaceparm, "lava" );
ApplySurfaceParm( surfaceparm, &lavaFlag, NULL, NULL );

int slimeFlag = 0;
strcpy( surfaceparm, "slime" );
ApplySurfaceParm( surfaceparm, &slimeFlag, NULL, NULL );

int skyFlag = 0;
if ( excludeSky ) {
strcpy( surfaceparm, "sky" );
ApplySurfaceParm( surfaceparm, NULL, &surfaceSkip, NULL );
ApplySurfaceParm( surfaceparm, NULL, &skyFlag, NULL );
}

int solidFlags = defaultFlag | playerclipFlag;
int contentSkip = playerclipFlag | nodropFlag | lavaFlag | slimeFlag;
int surfaceSkip = skyFlag;

/* get model, index 0 is worldspawn entity */
bspModel_t *model = &bspModels[0];

Expand All @@ -238,6 +252,11 @@ static void LoadBrushTris( std::vector<float> &verts, std::vector<int> &tris ) {
if ( !( brushShader->contentFlags & solidFlags ) ) {
continue;
}

if ( ( brushShader->contentFlags & contentSkip ) ) {
continue;
}

/* walk the list of brush sides */
for ( int p = 0; p < numSides; p++ )
{
Expand All @@ -250,6 +269,10 @@ static void LoadBrushTris( std::vector<float> &verts, std::vector<int> &tris ) {
continue;
}

if ( !Q_stricmp( shader->shader, "textures/common/outside" ) ) {
continue;
}

if ( excludeCaulk && !Q_stricmp( shader->shader, "textures/common/caulk" ) ) {
continue;
}
Expand Down Expand Up @@ -298,17 +321,18 @@ static qboolean BoundsIntersect( const vec3_t mins, const vec3_t maxs, const vec
static void LoadPatchTris( std::vector<float> &verts, std::vector<int> &tris ) {

vec3_t mins, maxs;
int solidFlags = 0;
int temp = 0;

char surfaceparm[16];

int defaultFlag = 0;
strcpy( surfaceparm, "default" );
ApplySurfaceParm( surfaceparm, &solidFlags, NULL, NULL );
ApplySurfaceParm( surfaceparm, &defaultFlag, NULL, NULL );

int playerclipFlag = 0;
strcpy( surfaceparm, "playerclip" );
ApplySurfaceParm( surfaceparm, &temp, NULL, NULL );
solidFlags |= temp;
ApplySurfaceParm( surfaceparm, &playerclipFlag, NULL, NULL );

int solidFlags = defaultFlag | playerclipFlag;

/*
Patches are not used during the bsp building process where
Expand Down