diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /scene/3d/decal.cpp | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'scene/3d/decal.cpp')
-rw-r--r-- | scene/3d/decal.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp index 4c824aedc4..fb72e10171 100644 --- a/scene/3d/decal.cpp +++ b/scene/3d/decal.cpp @@ -47,6 +47,7 @@ void Decal::set_texture(DecalTexture p_type, const Ref<Texture2D> &p_texture) { RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); RS::get_singleton()->decal_set_texture(decal, RS::DecalTexture(p_type), texture_rid); } + Ref<Texture2D> Decal::get_texture(DecalTexture p_type) const { ERR_FAIL_INDEX_V(p_type, TEXTURE_MAX, Ref<Texture2D>()); return textures[p_type]; @@ -56,6 +57,7 @@ void Decal::set_emission_energy(float p_energy) { emission_energy = p_energy; RS::get_singleton()->decal_set_emission_energy(decal, emission_energy); } + float Decal::get_emission_energy() const { return emission_energy; } @@ -64,6 +66,7 @@ void Decal::set_albedo_mix(float p_mix) { albedo_mix = p_mix; RS::get_singleton()->decal_set_albedo_mix(decal, albedo_mix); } + float Decal::get_albedo_mix() const { return albedo_mix; } @@ -72,6 +75,7 @@ void Decal::set_upper_fade(float p_fade) { upper_fade = p_fade; RS::get_singleton()->decal_set_fade(decal, upper_fade, lower_fade); } + float Decal::get_upper_fade() const { return upper_fade; } @@ -80,6 +84,7 @@ void Decal::set_lower_fade(float p_fade) { lower_fade = p_fade; RS::get_singleton()->decal_set_fade(decal, upper_fade, lower_fade); } + float Decal::get_lower_fade() const { return lower_fade; } @@ -88,6 +93,7 @@ void Decal::set_normal_fade(float p_fade) { normal_fade = p_fade; RS::get_singleton()->decal_set_normal_fade(decal, normal_fade); } + float Decal::get_normal_fade() const { return normal_fade; } @@ -105,6 +111,7 @@ void Decal::set_enable_distance_fade(bool p_enable) { distance_fade_enabled = p_enable; RS::get_singleton()->decal_set_distance_fade(decal, distance_fade_enabled, distance_fade_begin, distance_fade_length); } + bool Decal::is_distance_fade_enabled() const { return distance_fade_enabled; } @@ -113,6 +120,7 @@ void Decal::set_distance_fade_begin(float p_distance) { distance_fade_begin = p_distance; RS::get_singleton()->decal_set_distance_fade(decal, distance_fade_enabled, distance_fade_begin, distance_fade_length); } + float Decal::get_distance_fade_begin() const { return distance_fade_begin; } @@ -121,6 +129,7 @@ void Decal::set_distance_fade_length(float p_length) { distance_fade_length = p_length; RS::get_singleton()->decal_set_distance_fade(decal, distance_fade_enabled, distance_fade_begin, distance_fade_length); } + float Decal::get_distance_fade_length() const { return distance_fade_length; } @@ -129,24 +138,23 @@ void Decal::set_cull_mask(uint32_t p_layers) { cull_mask = p_layers; RS::get_singleton()->decal_set_cull_mask(decal, cull_mask); } + uint32_t Decal::get_cull_mask() const { return cull_mask; } AABB Decal::get_aabb() const { - AABB aabb; aabb.position = -extents; aabb.size = extents * 2.0; return aabb; } -Vector<Face3> Decal::get_faces(uint32_t p_usage_flags) const { +Vector<Face3> Decal::get_faces(uint32_t p_usage_flags) const { return Vector<Face3>(); } void Decal::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_extents", "extents"), &Decal::set_extents); ClassDB::bind_method(D_METHOD("get_extents"), &Decal::get_extents); @@ -212,7 +220,6 @@ void Decal::_bind_methods() { } Decal::Decal() { - extents = Vector3(1, 1, 1); emission_energy = 1.0; modulate = Color(1, 1, 1, 1); @@ -230,6 +237,5 @@ Decal::Decal() { } Decal::~Decal() { - RS::get_singleton()->free(decal); } |