diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/3d/light.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
download | redot-engine-5dbf1809c6e3e905b94b8764e99491e608122261.tar.gz |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'scene/3d/light.h')
-rw-r--r-- | scene/3d/light.h | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/scene/3d/light.h b/scene/3d/light.h index 4cf0156d5c..fd50f0fcc4 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -29,7 +29,6 @@ #ifndef LIGHT_H #define LIGHT_H - #include "scene/3d/visual_instance.h" #include "scene/resources/texture.h" #include "servers/visual_server.h" @@ -38,16 +37,14 @@ @author Juan Linietsky <reduzio@gmail.com> */ - class BakedLight; class Light : public VisualInstance { - GDCLASS( Light, VisualInstance ); + GDCLASS(Light, VisualInstance); OBJ_CATEGORY("3D Light Nodes"); public: - enum Param { PARAM_ENERGY = VS::LIGHT_PARAM_ENERGY, PARAM_SPECULAR = VS::LIGHT_PARAM_SPECULAR, @@ -55,7 +52,7 @@ public: PARAM_ATTENUATION = VS::LIGHT_PARAM_ATTENUATION, PARAM_SPOT_ANGLE = VS::LIGHT_PARAM_SPOT_ANGLE, PARAM_SPOT_ATTENUATION = VS::LIGHT_PARAM_SPOT_ATTENUATION, - PARAM_CONTACT_SHADOW_SIZE= VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE, + PARAM_CONTACT_SHADOW_SIZE = VS::LIGHT_PARAM_CONTACT_SHADOW_SIZE, PARAM_SHADOW_MAX_DISTANCE = VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE, PARAM_SHADOW_SPLIT_1_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, PARAM_SHADOW_SPLIT_2_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, @@ -67,7 +64,6 @@ public: }; private: - Color color; float param[PARAM_MAX]; Color shadow_color; @@ -79,21 +75,19 @@ private: void _update_visibility(); BakedLight *baked_light; -// bind helpers + // bind helpers protected: - RID light; virtual bool _can_gizmo_scale() const; - + static void _bind_methods(); void _notification(int p_what); - Light(VisualServer::LightType p_type); -public: +public: VS::LightType get_light_type() const { return type; } void set_editor_only(bool p_editor_only); @@ -111,30 +105,26 @@ public: void set_cull_mask(uint32_t p_cull_mask); uint32_t get_cull_mask() const; - void set_color(const Color& p_color); + void set_color(const Color &p_color); Color get_color() const; - void set_shadow_color(const Color& p_shadow_color); + void set_shadow_color(const Color &p_shadow_color); Color get_shadow_color() const; - virtual Rect3 get_aabb() const; virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; Light(); ~Light(); - }; VARIANT_ENUM_CAST(Light::Param); - class DirectionalLight : public Light { - GDCLASS( DirectionalLight, Light ); + GDCLASS(DirectionalLight, Light); public: - enum ShadowMode { SHADOW_ORTHOGONAL, SHADOW_PARALLEL_2_SPLITS, @@ -142,14 +132,13 @@ public: }; private: - bool blend_splits; ShadowMode shadow_mode; protected: static void _bind_methods(); -public: +public: void set_shadow_mode(ShadowMode p_mode); ShadowMode get_shadow_mode() const; @@ -163,7 +152,8 @@ VARIANT_ENUM_CAST(DirectionalLight::ShadowMode) class OmniLight : public Light { - GDCLASS( OmniLight, Light ); + GDCLASS(OmniLight, Light); + public: // omni light enum ShadowMode { @@ -178,14 +168,13 @@ public: }; private: - ShadowMode shadow_mode; ShadowDetail shadow_detail; + protected: static void _bind_methods(); public: - void set_shadow_mode(ShadowMode p_mode); ShadowMode get_shadow_mode() const; @@ -200,14 +189,14 @@ VARIANT_ENUM_CAST(OmniLight::ShadowDetail) class SpotLight : public Light { - GDCLASS( SpotLight, Light ); + GDCLASS(SpotLight, Light); + protected: static void _bind_methods(); -public: - - SpotLight() : Light( VisualServer::LIGHT_SPOT ) {} +public: + SpotLight() + : Light(VisualServer::LIGHT_SPOT) {} }; - #endif |