vmap: Fix broken implementation of func_detail_illusionary

This commit is contained in:
Marco Cawthorne 2021-07-08 23:43:59 +02:00
parent 223182aac5
commit cea3bc68d9
3 changed files with 18 additions and 6 deletions

View file

@ -1298,7 +1298,8 @@ static void ForceBrushesToDetail(entity_t *ent, qboolean illusionary)
for ( b = ent->brushes; b != NULL; b = b->next )
{
if (illusionary)
b->contentFlags &= C_SOLID;
b->nosolid = qtrue;
if (!b->detail && !(b->compileFlags & (C_DETAIL|C_STRUCTURAL)))
{
c_structural--;
@ -1769,7 +1770,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
else if ( !Q_stricmp( "func_detail", classname ) || !Q_stricmp( "func_detail_wall", classname ) || !Q_stricmp( "func_detail_fence", classname ) ) {
funcGroupType = funcgroup_detail;
}
else if ( !Q_stricmp( "func_detail_illusionary ", classname ) ) {
else if ( !Q_stricmp( "func_detail_illusionary", classname ) ) {
funcGroupType = funcgroup_detail_illusionary;
}else{
funcGroupType = funcgroup_not;

View file

@ -895,6 +895,7 @@ typedef struct brush_s
int contentFlags;
int compileFlags; /* ydnar */
qboolean nosolid;
qboolean detail;
qboolean opaque;

View file

@ -455,7 +455,14 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
( *numBrushes )++;
}
db->shaderNum = EmitShader( b->contentShader->shader, &b->contentShader->contentFlags, &b->contentShader->surfaceFlags );
int ns = 0x4000;
int nx = 0;
if (b->nosolid)
db->shaderNum = EmitShader( b->contentShader->shader, &nx, &ns );
else
db->shaderNum = EmitShader( b->contentShader->shader, &b->contentShader->contentFlags, &b->contentShader->surfaceFlags );
db->firstSide = numBSPBrushSides;
/* walk sides */
@ -477,9 +484,12 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
/* emit shader */
if ( b->sides[ j ].shaderInfo ) {
cp->shaderNum = EmitShader( b->sides[ j ].shaderInfo->shader, &b->sides[ j ].shaderInfo->contentFlags, &b->sides[ j ].shaderInfo->surfaceFlags );
}
else{
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 );
} else {
cp->shaderNum = EmitShader( NULL, NULL, NULL );
}
}