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/style/light_impl.hpp | |
parent | 8fb1a81c46f4358d731712c16868aa1108d5d34c (diff) | |
download | qtlocation-mapboxgl-3fa9f3c9e8fa99bef08f244755368e0879672074.tar.gz |
[core] Merge light_properties.hpp into light_impl.hpp
Diffstat (limited to 'src/mbgl/style/light_impl.hpp')
-rw-r--r-- | src/mbgl/style/light_impl.hpp | 44 |
1 files changed, 43 insertions, 1 deletions
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; |