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) static void ForceBrushesToDetail(entity_t *ent, qboolean illusionary)
{ {
brush_t *b; brush_t *b;
parseMesh_t *p;
for ( b = ent->brushes; b != NULL; b = b->next ) for ( b = ent->brushes; b != NULL; b = b->next )
{ {
if (illusionary) if (illusionary)
@ -1308,6 +1310,12 @@ static void ForceBrushesToDetail(entity_t *ent, qboolean illusionary)
b->detail = qtrue; 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; ds->sampleSize = 0;
/* emit the new fake shader */ /* emit the new fake shader */
if (ds->mapMesh->nosolid)
surfaceFlags |= 0x4000;
out->shaderNum = EmitShader( ds->shaderInfo->shader, &contentFlags, &surfaceFlags ); out->shaderNum = EmitShader( ds->shaderInfo->shader, &contentFlags, &surfaceFlags );
} }
else{ 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->patchWidth = ds->patchWidth;
out->patchHeight = ds->patchHeight; out->patchHeight = ds->patchHeight;

View file

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

View file

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