summaryrefslogtreecommitdiff
path: root/scene/main/scene_main_loop.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-07 22:22:54 +0200
committerGitHub <noreply@github.com>2017-04-07 22:22:54 +0200
commitb81d5f4687a5f56c6cd5fc9b4545ff792378d3c7 (patch)
tree2fe73b9c38cd02fe4d851f5e8f5b50d2af449af1 /scene/main/scene_main_loop.cpp
parentfc45c1e6eb361c6ff4d5d76c39c7a34b113c7216 (diff)
parent665bf529481c0dbe9345d2473bce8f8d99ece0c5 (diff)
Merge pull request #8308 from RandomShaper/optimize-out-debug-n-non-tools
Optimize-out some debug and/or non-tools methods
Diffstat (limited to 'scene/main/scene_main_loop.cpp')
-rw-r--r--scene/main/scene_main_loop.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index fb40eec463..e993422d46 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -682,24 +682,24 @@ void SceneTree::set_quit_on_go_back(bool p_enable) {
quit_on_go_back = p_enable;
}
+#ifdef TOOLS_ENABLED
void SceneTree::set_editor_hint(bool p_enabled) {
editor_hint = p_enabled;
}
bool SceneTree::is_node_being_edited(const Node *p_node) const {
-#ifdef TOOLS_ENABLED
+
return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node);
-#else
- return false;
-#endif
}
bool SceneTree::is_editor_hint() const {
return editor_hint;
}
+#endif
+#ifdef DEBUG_ENABLED
void SceneTree::set_debug_collisions_hint(bool p_enabled) {
debug_collisions_hint = p_enabled;
@@ -719,6 +719,7 @@ bool SceneTree::is_debugging_navigation_hint() const {
return debug_navigation_hint;
}
+#endif
void SceneTree::set_debug_collisions_color(const Color &p_color) {
@@ -2265,9 +2266,13 @@ SceneTree::SceneTree() {
singleton = this;
_quit = false;
initialized = false;
+#ifdef TOOLS_ENABLED
editor_hint = false;
+#endif
+#ifdef DEBUG_ENABLED
debug_collisions_hint = false;
debug_navigation_hint = false;
+#endif
debug_collisions_color = GLOBAL_DEF("debug/collision/shape_color", Color(0.0, 0.6, 0.7, 0.5));
debug_collision_contact_color = GLOBAL_DEF("debug/collision/contact_color", Color(1.0, 0.2, 0.1, 0.8));
debug_navigation_color = GLOBAL_DEF("debug/navigation/geometry_color", Color(0.1, 1.0, 0.7, 0.4));