add _nofill key, which causes an entity to not count as an entity for the purposes of occupancy (for lights in walls, etc)

add _nonudge key, to disabling nudging of lights "stuck" inside walls
This commit is contained in:
Jonathan 2022-12-15 04:30:22 -05:00
parent 6451a3f2aa
commit d5e29a1c90
3 changed files with 7 additions and 6 deletions

View File

@ -101,6 +101,7 @@ public:
settings::setting_int32 surflight_group;
settings::setting_int32 light_channel_mask;
settings::setting_int32 shadow_channel_mask;
settings::setting_bool nonudge;
light_t();

View File

@ -107,7 +107,8 @@ light_t::light_t() :
nostaticlight{this, "nostaticlight", false},
surflight_group{this, "surflight_group", 0},
light_channel_mask{this, "light_channel_mask", CHANNEL_MASK_DEFAULT},
shadow_channel_mask{this, "shadow_channel_mask", CHANNEL_MASK_DEFAULT}
shadow_channel_mask{this, "shadow_channel_mask", CHANNEL_MASK_DEFAULT},
nonudge{this, "nonudge", false}
{}
std::string light_t::classname() const
@ -1021,7 +1022,7 @@ static qvec3d FixLightOnFace(const mbsp_t *bsp, const qvec3d &point)
void FixLightsOnFaces(const mbsp_t *bsp)
{
for (auto &entity : all_lights) {
if (entity->light.value() != 0) {
if (entity->light.value() != 0 && !entity->nonudge.value()) {
entity->origin.setValue(FixLightOnFace(bsp, entity->origin.value()), settings::source::MAP);
}
}

View File

@ -322,11 +322,10 @@ static void MarkOccupiedClusters(node_t *headnode)
if (qv::epsilonEmpty(entity.origin, QBSP_EQUAL_EPSILON))
continue;
#if 0
/* skip lights */
if (strcmp(ValueForKey(entity, "classname"), "light") == 0)
// skip nofill entities
if (entity.epairs.has("_nofill") && entity.epairs.get_int("_nofill")) {
continue;
#endif
}
/* find the leaf it's in. Skip opqaue leafs */
node_t *cluster = PointInLeaf(headnode, entity.origin);