vmap: patches will now be affected by func_detail_illusionary as well.

This commit is contained in:
Marco Cawthorne 2021-07-09 08:04:30 +02:00
parent cea3bc68d9
commit 90d3f523bb
4 changed files with 33 additions and 12 deletions

View file

@ -1295,6 +1295,8 @@ static void ParseBrush( qboolean onlyLights, qboolean noCollapseGroups ){
static void ForceBrushesToDetail(entity_t *ent, qboolean illusionary)
{
brush_t *b;
parseMesh_t *p;
for ( b = ent->brushes; b != NULL; b = b->next )
{
if (illusionary)
@ -1308,6 +1310,12 @@ static void ForceBrushesToDetail(entity_t *ent, qboolean illusionary)
b->detail = qtrue;
}
}
if (!illusionary)
return;
for (p = ent->patches; p != NULL; p = p->next )
p->nosolid = qtrue;
}
/*

View file

@ -2593,10 +2593,18 @@ void EmitPatchSurface( entity_t *e, mapDrawSurface_t *ds ){
ds->sampleSize = 0;
/* emit the new fake shader */
if (ds->mapMesh->nosolid)
surfaceFlags |= 0x4000;
out->shaderNum = EmitShader( ds->shaderInfo->shader, &contentFlags, &surfaceFlags );
}
else{
out->shaderNum = EmitShader( ds->shaderInfo->shader, &ds->shaderInfo->contentFlags, &ds->shaderInfo->surfaceFlags );
surfaceFlags = ds->shaderInfo->surfaceFlags;
if (ds->mapMesh->nosolid)
surfaceFlags |= 0x4000;
out->shaderNum = EmitShader( ds->shaderInfo->shader, &ds->shaderInfo->contentFlags, &surfaceFlags );
}
out->patchWidth = ds->patchWidth;
out->patchHeight = ds->patchHeight;

View file

@ -931,7 +931,7 @@ typedef struct
}
mesh_t;
/* really should be patch_t, innit - eukara */
typedef struct parseMesh_s
{
struct parseMesh_s *next;
@ -957,6 +957,7 @@ typedef struct parseMesh_s
qboolean grouped;
float longestCurve;
int maxIterations;
qboolean nosolid;
}
parseMesh_t;

View file

@ -431,6 +431,8 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
brush_t *b;
bspBrush_t *db;
bspBrushSide_t *cp;
int surfaceFlags;
int contentFlags;
/* set initial brush */
@ -455,14 +457,15 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
( *numBrushes )++;
}
int ns = 0x4000;
int nx = 0;
surfaceFlags = b->contentShader->surfaceFlags;
contentFlags = b->contentShader->contentFlags;
if (b->nosolid)
db->shaderNum = EmitShader( b->contentShader->shader, &nx, &ns );
else
db->shaderNum = EmitShader( b->contentShader->shader, &b->contentShader->contentFlags, &b->contentShader->surfaceFlags );
if (b->nosolid) {
contentFlags &= ~1;
surfaceFlags |= 0x4000;
}
db->shaderNum = EmitShader( b->contentShader->shader, &contentFlags, &surfaceFlags );
db->firstSide = numBSPBrushSides;
/* walk sides */
@ -484,11 +487,12 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
/* emit shader */
if ( b->sides[ j ].shaderInfo ) {
surfaceFlags = b->sides[ j ].shaderInfo->surfaceFlags;
if (b->nosolid)
cp->shaderNum = EmitShader( b->sides[ j ].shaderInfo->shader, &nx, &ns );
else
cp->shaderNum = EmitShader( b->sides[ j ].shaderInfo->shader, &b->sides[ j ].shaderInfo->contentFlags, &b->sides[ j ].shaderInfo->surfaceFlags );
surfaceFlags |= 0x4000;
cp->shaderNum = EmitShader( b->sides[ j ].shaderInfo->shader, &b->sides[ j ].shaderInfo->contentFlags, &surfaceFlags);
} else {
cp->shaderNum = EmitShader( NULL, NULL, NULL );
}