diff options
author | Joan Fons <joan.fonssanchez@gmail.com> | 2021-07-19 19:25:15 +0200 |
---|---|---|
committer | Joan Fons <joan.fonssanchez@gmail.com> | 2021-07-20 20:35:41 +0200 |
commit | a6adb584934a885adf6ca775f2ef7118b66f684e (patch) | |
tree | ff32816397839c53f5cbe65a852210d63fd5693c /scene/main/scene_tree.cpp | |
parent | b1eee24e2673b4a980a6f661511ff0f18c2fff8a (diff) | |
download | redot-engine-a6adb584934a885adf6ca775f2ef7118b66f684e.tar.gz |
Editor StringName and Viewport optimizations
* Added explicit return type to the SNAME macro.
* Add some extra SNAME usages.
* Change some ClassDB methods to use const StringName & arguments.
* Cache the Window parent in Control because it's used in
is_layout_rtl(), which is called often.
* Only enable internal processing for viewports that need it.
* Change CanvasItem::group to be a StringName because it's only used as
that.
Diffstat (limited to 'scene/main/scene_tree.cpp')
-rw-r--r-- | scene/main/scene_tree.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 2a5be0314d..182b143b3a 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -408,9 +408,9 @@ bool SceneTree::physics_process(float p_time) { emit_signal(SNAME("physics_frame")); - _notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS); - call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_process_picking"); - _notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS); + _notify_group_pause(SNAME("physics_process_internal"), Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS); + call_group_flags(GROUP_CALL_REALTIME, SNAME("_picking_viewports"), SNAME("_process_picking")); + _notify_group_pause(SNAME("physics_process"), Node::NOTIFICATION_PHYSICS_PROCESS); _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack @@ -442,8 +442,8 @@ bool SceneTree::process(float p_time) { flush_transform_notifications(); - _notify_group_pause("process_internal", Node::NOTIFICATION_INTERNAL_PROCESS); - _notify_group_pause("process", Node::NOTIFICATION_PROCESS); + _notify_group_pause(SNAME("process_internal"), Node::NOTIFICATION_INTERNAL_PROCESS); + _notify_group_pause(SNAME("process"), Node::NOTIFICATION_PROCESS); _flush_ugc(); MessageQueue::get_singleton()->flush(); //small little hack @@ -490,7 +490,7 @@ bool SceneTree::process(float p_time) { if (Engine::get_singleton()->is_editor_hint()) { //simple hack to reload fallback environment if it changed from editor - String env_path = ProjectSettings::get_singleton()->get("rendering/environment/defaults/default_environment"); + String env_path = ProjectSettings::get_singleton()->get(SNAME("rendering/environment/defaults/default_environment")); env_path = env_path.strip_edges(); //user may have added a space or two String cpath; Ref<Environment> fallback = get_root()->get_world_3d()->get_fallback_environment(); |