summaryrefslogtreecommitdiff
path: root/scene/3d/lightmap_gi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/lightmap_gi.cpp')
-rw-r--r--scene/3d/lightmap_gi.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp
index 825742da35..68d2b91fad 100644
--- a/scene/3d/lightmap_gi.cpp
+++ b/scene/3d/lightmap_gi.cpp
@@ -1176,16 +1176,18 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa
}
void LightmapGI::_notification(int p_what) {
- if (p_what == NOTIFICATION_POST_ENTER_TREE) {
- if (light_data.is_valid()) {
- _assign_lightmaps();
- }
- }
+ switch (p_what) {
+ case NOTIFICATION_POST_ENTER_TREE: {
+ if (light_data.is_valid()) {
+ _assign_lightmaps();
+ }
+ } break;
- if (p_what == NOTIFICATION_EXIT_TREE) {
- if (light_data.is_valid()) {
- _clear_lightmaps();
- }
+ case NOTIFICATION_EXIT_TREE: {
+ if (light_data.is_valid()) {
+ _clear_lightmaps();
+ }
+ } break;
}
}