diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-10 11:42:39 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-15 09:45:55 -0700 |
commit | 3fa9f3c9e8fa99bef08f244755368e0879672074 (patch) | |
tree | 541afd256864f7882f186d14cb1983919acaed5d /src/mbgl | |
parent | 8fb1a81c46f4358d731712c16868aa1108d5d34c (diff) | |
download | qtlocation-mapboxgl-3fa9f3c9e8fa99bef08f244755368e0879672074.tar.gz |
[core] Merge light_properties.hpp into light_impl.hpp
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/renderer/render_light.hpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/light.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/style/light.cpp.ejs | 1 | ||||
-rw-r--r-- | src/mbgl/style/light_impl.hpp | 44 | ||||
-rw-r--r-- | src/mbgl/style/light_properties.hpp | 51 |
5 files changed, 43 insertions, 55 deletions
diff --git a/src/mbgl/renderer/render_light.hpp b/src/mbgl/renderer/render_light.hpp index ed8d8bf59c..7e0662105f 100644 --- a/src/mbgl/renderer/render_light.hpp +++ b/src/mbgl/renderer/render_light.hpp @@ -1,7 +1,6 @@ #pragma once #include <mbgl/style/light_impl.hpp> -#include <mbgl/style/light_properties.hpp> #include <mbgl/renderer/transitioning_property.hpp> #include <mbgl/renderer/cascade_parameters.hpp> #include <mbgl/renderer/property_evaluator.hpp> diff --git a/src/mbgl/style/light.cpp b/src/mbgl/style/light.cpp index d2f91c73af..651a323da4 100644 --- a/src/mbgl/style/light.cpp +++ b/src/mbgl/style/light.cpp @@ -3,7 +3,6 @@ #include <mbgl/style/light.hpp> #include <mbgl/style/light_impl.hpp> #include <mbgl/style/light_observer.hpp> -#include <mbgl/style/light_properties.hpp> namespace mbgl { namespace style { diff --git a/src/mbgl/style/light.cpp.ejs b/src/mbgl/style/light.cpp.ejs index 454bad49d8..e933e40b97 100644 --- a/src/mbgl/style/light.cpp.ejs +++ b/src/mbgl/style/light.cpp.ejs @@ -6,7 +6,6 @@ #include <mbgl/style/light.hpp> #include <mbgl/style/light_impl.hpp> #include <mbgl/style/light_observer.hpp> -#include <mbgl/style/light_properties.hpp> namespace mbgl { namespace style { diff --git a/src/mbgl/style/light_impl.hpp b/src/mbgl/style/light_impl.hpp index d607cf00e5..4179c2b276 100644 --- a/src/mbgl/style/light_impl.hpp +++ b/src/mbgl/style/light_impl.hpp @@ -1,11 +1,53 @@ #pragma once #include <mbgl/style/light.hpp> -#include <mbgl/style/light_properties.hpp> +#include <mbgl/style/property_value.hpp> +#include <mbgl/style/transition_options.hpp> +#include <mbgl/style/types.hpp> +#include <mbgl/style/position.hpp> +#include <mbgl/util/color.hpp> +#include <mbgl/util/indexed_tuple.hpp> namespace mbgl { namespace style { +template <class T> +class LightProperty { +public: + using Type = T; + using ValueType = PropertyValue<T>; + + PropertyValue<T> value; + TransitionOptions transition; +}; + +struct LightAnchor : LightProperty<LightAnchorType> { + static LightAnchorType defaultValue() { + return LightAnchorType::Viewport; + } +}; + +struct LightPosition : LightProperty<Position> { + static Position defaultValue() { + std::array<float, 3> default_ = { { 1.15, 210, 30 } }; + return Position{ { default_ } }; + } +}; + +struct LightColor : LightProperty<Color> { + static Color defaultValue() { + return Color::white(); + } +}; + +struct LightIntensity : LightProperty<float> { + static float defaultValue() { + return 0.5; + } +}; + +using LightProperties = TypeList<LightAnchor, LightPosition, LightColor, LightIntensity>; + class Light::Impl { public: IndexedTuple<LightProperties, LightProperties> properties; diff --git a/src/mbgl/style/light_properties.hpp b/src/mbgl/style/light_properties.hpp deleted file mode 100644 index 9f6088a633..0000000000 --- a/src/mbgl/style/light_properties.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include <mbgl/style/property_value.hpp> -#include <mbgl/style/transition_options.hpp> -#include <mbgl/style/types.hpp> -#include <mbgl/style/position.hpp> -#include <mbgl/util/color.hpp> -#include <mbgl/util/indexed_tuple.hpp> - -namespace mbgl { -namespace style { - -template <class T> -class LightProperty { -public: - using Type = T; - using ValueType = PropertyValue<T>; - - PropertyValue<T> value; - TransitionOptions transition; -}; - -struct LightAnchor : LightProperty<LightAnchorType> { - static LightAnchorType defaultValue() { - return LightAnchorType::Viewport; - } -}; - -struct LightPosition : LightProperty<Position> { - static Position defaultValue() { - std::array<float, 3> default_ = { { 1.15, 210, 30 } }; - return Position{ { default_ } }; - } -}; - -struct LightColor : LightProperty<Color> { - static Color defaultValue() { - return Color::white(); - } -}; - -struct LightIntensity : LightProperty<float> { - static float defaultValue() { - return 0.5; - } -}; - -using LightProperties = TypeList<LightAnchor, LightPosition, LightColor, LightIntensity>; - -} // namespace style -} // namespace mbgl |