summaryrefslogtreecommitdiffstats
path: root/scene/main/scene_tree.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 14:29:06 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch)
tree43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/main/scene_tree.cpp
parent0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff)
downloadredot-engine-07bc4e2f96f8f47991339654ff4ab16acc19d44f.tar.gz
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
Diffstat (limited to 'scene/main/scene_tree.cpp')
-rw-r--r--scene/main/scene_tree.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 018d08d9fc..41fc830f48 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -530,6 +530,7 @@ void SceneTree::_main_window_close() {
_quit = true;
}
}
+
void SceneTree::_main_window_go_back() {
if (quit_on_go_back) {
_quit = true;
@@ -660,6 +661,7 @@ Ref<Material> SceneTree::get_debug_navigation_disabled_material() {
return navigation_disabled_material;
}
+
Ref<Material> SceneTree::get_debug_collision_material() {
if (collision_material.is_valid())
return collision_material;
@@ -792,6 +794,7 @@ void SceneMainLoop::_update_listener_2d() {
}
}
+
*/
void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input, Viewport *p_viewport) {
@@ -835,6 +838,7 @@ void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p
if (call_lock == 0)
call_skip.clear();
}
+
Variant SceneTree::_call_group_flags(const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
r_error.error = Callable::CallError::CALL_OK;
@@ -878,6 +882,7 @@ Variant SceneTree::_call_group(const Variant **p_args, int p_argcount, Callable:
int64_t SceneTree::get_frame() const {
return current_frame;
}
+
int64_t SceneTree::get_event_count() const {
return current_event;
}
@@ -906,6 +911,7 @@ Array SceneTree::_get_nodes_in_group(const StringName &p_group) {
bool SceneTree::has_group(const StringName &p_identifier) const {
return group_map.has(p_identifier);
}
+
void SceneTree::get_nodes_in_group(const StringName &p_group, List<Node *> *p_list) {
Map<StringName, Group>::Element *E = group_map.find(p_group);
if (!E)