vmap: Add _entsurfaceflags. Which allows an entity (even func_detail) to add upon

surfaceflags of a brush. Experimental and hacky.
This commit is contained in:
Marco Cawthorne 2022-04-12 20:52:09 -07:00
parent 70932b8eab
commit f0c0c4f4a4
Signed by: eukara
GPG Key ID: C196CD8BA993248A
3 changed files with 10 additions and 2 deletions

View File

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

View File

@ -899,6 +899,7 @@ typedef struct brush_s
qboolean nosolid;
qboolean detail;
qboolean opaque;
int entSurfaceFlags;
int portalareas[ 2 ];
@ -959,6 +960,7 @@ typedef struct parseMesh_s
float longestCurve;
int maxIterations;
qboolean nosolid;
int entSurfaceFlags;
}
parseMesh_t;

View File

@ -458,7 +458,7 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
( *numBrushes )++;
}
surfaceFlags = b->contentShader->surfaceFlags;
surfaceFlags = b->contentShader->surfaceFlags | b->entSurfaceFlags;
contentFlags = b->contentShader->contentFlags;
if (b->nosolid) {
@ -488,7 +488,7 @@ void EmitBrushes( brush_t *brushes, int *firstBrush, int *numBrushes ){
/* emit shader */
if ( b->sides[ j ].shaderInfo ) {
surfaceFlags = b->sides[ j ].shaderInfo->surfaceFlags;
surfaceFlags = b->sides[ j ].shaderInfo->surfaceFlags | b->entSurfaceFlags;
if (b->nosolid)
surfaceFlags |= 0x4000;