vmap: Add _entcontentflags, which like _entsurfaceflags controls content flags on a per brush-entity basis

This commit is contained in:
Marco Cawthorne 2022-04-12 21:23:44 -07:00
parent f0c0c4f4a4
commit 9df6ec6305
Signed by: eukara
GPG key ID: C196CD8BA993248A
3 changed files with 9 additions and 2 deletions

View file

@ -1655,7 +1655,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
const char *classname, *value;
float lightmapScale, shadeAngle;
int lightmapSampleSize;
int entSurfFlag;
int entSurfFlag, entContFlag;
char shader[ MAX_QPATH ];
shaderInfo_t *celShader = NULL;
brush_t *brush;
@ -1836,6 +1836,9 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
entSurfFlag = 0;
entSurfFlag = IntForKey( mapEnt, "_entsurfaceflags");
entContFlag = 0;
entContFlag = IntForKey( mapEnt, "_entcontentflags");
/* ydnar: get cel shader :) for this entity */
value = ValueForKey( mapEnt, "_celshader" );
if ( value[ 0 ] == '\0' ) {
@ -1908,6 +1911,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
brush->celShader = celShader;
brush->shadeAngleDegrees = shadeAngle;
brush->entSurfaceFlags = entSurfFlag;
brush->entContentFlags = entContFlag;
}
for ( patch = mapEnt->patches; patch != NULL; patch = patch->next )
@ -1919,6 +1923,7 @@ static qboolean ParseMapEntity( qboolean onlyLights, qboolean noCollapseGroups )
patch->lightmapScale = lightmapScale;
patch->celShader = celShader;
patch->entSurfaceFlags = entSurfFlag;
patch->entContentFlags = entContFlag;
}
/* ydnar: gs mods: set entity bounds */

View file

@ -900,6 +900,7 @@ typedef struct brush_s
qboolean detail;
qboolean opaque;
int entSurfaceFlags;
int entContentFlags;
int portalareas[ 2 ];
@ -961,6 +962,7 @@ typedef struct parseMesh_s
int maxIterations;
qboolean nosolid;
int entSurfaceFlags;
int entContentFlags;
}
parseMesh_t;

View file

@ -459,7 +459,7 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
}
surfaceFlags = b->contentShader->surfaceFlags | b->entSurfaceFlags;
contentFlags = b->contentShader->contentFlags;
contentFlags = b->contentShader->contentFlags | b->entContentFlags;
if (b->nosolid) {
contentFlags &= ~1;