diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 14:29:06 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch) | |
tree | 43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/3d/baked_lightmap.cpp | |
parent | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff) | |
download | redot-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/3d/baked_lightmap.cpp')
-rw-r--r-- | scene/3d/baked_lightmap.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index 8838295e93..33db919d49 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -52,6 +52,7 @@ void BakedLightmapData::add_user(const NodePath &p_path, const Rect2 &p_uv_scale int BakedLightmapData::get_user_count() const { return users.size(); } + NodePath BakedLightmapData::get_user_path(int p_user) const { ERR_FAIL_INDEX_V(p_user, users.size(), NodePath()); return users[p_user].path; @@ -142,9 +143,11 @@ void BakedLightmapData::set_capture_data(const AABB &p_bounds, bool p_interior, PackedVector3Array BakedLightmapData::get_capture_points() const { return RS::get_singleton()->lightmap_get_probe_capture_points(lightmap); } + PackedColorArray BakedLightmapData::get_capture_sh() const { return RS::get_singleton()->lightmap_get_probe_capture_sh(lightmap); } + PackedInt32Array BakedLightmapData::get_capture_tetrahedra() const { return RS::get_singleton()->lightmap_get_probe_capture_tetrahedra(lightmap); } @@ -181,6 +184,7 @@ Dictionary BakedLightmapData::_get_probe_data() const { d["interior"] = is_interior(); return d; } + void BakedLightmapData::_bind_methods() { ClassDB::bind_method(D_METHOD("_set_user_data", "data"), &BakedLightmapData::_set_user_data); ClassDB::bind_method(D_METHOD("_get_user_data"), &BakedLightmapData::_get_user_data); @@ -569,6 +573,7 @@ void BakedLightmap::_plot_triangle_into_octree(GenProbesOctree *p_cell, float p_ } } } + void BakedLightmap::_gen_new_positions_from_octree(const GenProbesOctree *p_cell, float p_cell_size, const Vector<Vector3> &probe_positions, LocalVector<Vector3> &new_probe_positions, HashMap<Vector3i, bool, Vector3iHash> &positions_used, const AABB &p_bounds) { for (int i = 0; i < 8; i++) { Vector3i pos = p_cell->offset; @@ -608,6 +613,7 @@ void BakedLightmap::_gen_new_positions_from_octree(const GenProbesOctree *p_cell } } } + BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, String p_image_data_path, Lightmapper::BakeStepFunc p_bake_step, void *p_bake_userdata) { if (p_image_data_path == "" && (get_light_data().is_null() || !get_light_data()->get_path().is_resource_file())) { return BAKE_ERROR_NO_SAVE_PATH; @@ -1262,6 +1268,7 @@ BakedLightmap::BakeQuality BakedLightmap::get_bake_quality() const { AABB BakedLightmap::get_aabb() const { return AABB(); } + Vector<Face3> BakedLightmap::get_faces(uint32_t p_usage_flags) const { return Vector<Face3>(); } @@ -1285,6 +1292,7 @@ bool BakedLightmap::is_directional() const { void BakedLightmap::set_interior(bool p_enable) { interior = p_enable; } + bool BakedLightmap::is_interior() const { return interior; } @@ -1309,6 +1317,7 @@ Ref<Sky> BakedLightmap::get_environment_custom_sky() const { void BakedLightmap::set_environment_custom_color(const Color &p_color) { environment_custom_color = p_color; } + Color BakedLightmap::get_environment_custom_color() const { return environment_custom_color; } @@ -1316,6 +1325,7 @@ Color BakedLightmap::get_environment_custom_color() const { void BakedLightmap::set_environment_custom_energy(float p_energy) { environment_custom_energy = p_energy; } + float BakedLightmap::get_environment_custom_energy() const { return environment_custom_energy; } |