vmap: Detect 'generatelightmaps' inside prop_static to decide whether or

not to bake an entity into the .bsp or not.
This commit is contained in:
Marco Cawthorne 2022-01-20 14:58:05 -08:00
parent c4655a19e1
commit ed1b1d6338
Signed by: eukara
GPG key ID: C196CD8BA993248A
2 changed files with 17 additions and 1 deletions

View file

@ -834,12 +834,20 @@ void UnparseEntities( void ){
/* ydnar: certain entities get stripped from bsp file */
value2 = ValueForKey( &entities[ i ], "classname" );
if ( !Q_stricmp( value2, "misc_model" ) ||
!Q_stricmp( value2, "prop_static" ) ||
!Q_stricmp( value2, "_decal" ) ||
!Q_stricmp( value2, "_skybox" ) ) {
continue;
}
/* only strip prop_statics that are built into the bsp */
if (!Q_stricmp( value2, "prop_static" )) {
int foo;
foo = IntForKey(&entities[i], "generatelightmaps");
if (foo == 1)
continue;
}
/* add beginning brace */
strcat( end, "{\n" );
end += 2;

View file

@ -689,6 +689,7 @@ void AddTriangleModels( entity_t *e ){
float temp, baseLightmapScale, lightmapScale;
float shadeAngle;
int lightmapSampleSize;
int genlightMap;
vec3_t origin, scale, angles;
m4x4_t transform;
epair_t *ep;
@ -745,6 +746,12 @@ void AddTriangleModels( entity_t *e ){
continue;
}
/* only bake into the map if we're generating lightmaps */
genlightMap = IntForKey( e2, "generatelightmaps" );
if (genlightMap != 1)
continue;
/* ydnar: added support for md3 models on non-worldspawn models */
target = ValueForKey( e2, "target" );
if ( strcmp( target, targetName ) ) {
@ -931,6 +938,7 @@ void AddTriangleModels( entity_t *e ){
/* insert the model */
InsertModel( model, skin, frame, transform, remap, celShader, mapEntityNum, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle );
printf("Inserting model %s\n", model);
/* free shader remappings */
while ( remap != NULL )