Don't emit changed signal for disabled lights.

This commit is contained in:
Relintai 2024-03-27 08:04:16 +01:00
parent 76c5252239
commit 34603315e4
2 changed files with 7 additions and 1 deletions

View File

@ -162,7 +162,7 @@ void VertexLights2DServer::light_set_enabled(RID p_light, const bool p_enabled)
light->enabled = p_enabled;
_light_changed(light);
_light_enabled_changed(light);
}
Vector2 VertexLights2DServer::light_get_position(RID p_light) {

View File

@ -215,6 +215,12 @@ protected:
};
_FORCE_INLINE_ void _light_changed(const VertexLightData2D *p_light) const {
if (p_light && p_light->enabled && p_light->map) {
_changed_maps.insert(p_light->map->self);
}
}
_FORCE_INLINE_ void _light_enabled_changed(const VertexLightData2D *p_light) const {
if (p_light && p_light->map) {
_changed_maps.insert(p_light->map->self);
}