From 3fa9f3c9e8fa99bef08f244755368e0879672074 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 10 May 2017 11:42:39 -0700 Subject: [PATCH] [core] Merge light_properties.hpp into light_impl.hpp --- src/mbgl/renderer/render_light.hpp | 1 - src/mbgl/style/light.cpp | 1 - src/mbgl/style/light.cpp.ejs | 1 - src/mbgl/style/light_impl.hpp | 44 ++++++++++++++++++++++++- src/mbgl/style/light_properties.hpp | 51 ----------------------------- 5 files changed, 43 insertions(+), 55 deletions(-) delete mode 100644 src/mbgl/style/light_properties.hpp diff --git a/src/mbgl/renderer/render_light.hpp b/src/mbgl/renderer/render_light.hpp index ed8d8bf59..7e0662105 100644 --- a/src/mbgl/renderer/render_light.hpp +++ b/src/mbgl/renderer/render_light.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include diff --git a/src/mbgl/style/light.cpp b/src/mbgl/style/light.cpp index d2f91c73a..651a323da 100644 --- a/src/mbgl/style/light.cpp +++ b/src/mbgl/style/light.cpp @@ -3,7 +3,6 @@ #include #include #include -#include namespace mbgl { namespace style { diff --git a/src/mbgl/style/light.cpp.ejs b/src/mbgl/style/light.cpp.ejs index 454bad49d..e933e40b9 100644 --- a/src/mbgl/style/light.cpp.ejs +++ b/src/mbgl/style/light.cpp.ejs @@ -6,7 +6,6 @@ #include #include #include -#include namespace mbgl { namespace style { diff --git a/src/mbgl/style/light_impl.hpp b/src/mbgl/style/light_impl.hpp index d607cf00e..4179c2b27 100644 --- a/src/mbgl/style/light_impl.hpp +++ b/src/mbgl/style/light_impl.hpp @@ -1,11 +1,53 @@ #pragma once #include -#include +#include +#include +#include +#include +#include +#include namespace mbgl { namespace style { +template +class LightProperty { +public: + using Type = T; + using ValueType = PropertyValue; + + PropertyValue value; + TransitionOptions transition; +}; + +struct LightAnchor : LightProperty { + static LightAnchorType defaultValue() { + return LightAnchorType::Viewport; + } +}; + +struct LightPosition : LightProperty { + static Position defaultValue() { + std::array default_ = { { 1.15, 210, 30 } }; + return Position{ { default_ } }; + } +}; + +struct LightColor : LightProperty { + static Color defaultValue() { + return Color::white(); + } +}; + +struct LightIntensity : LightProperty { + static float defaultValue() { + return 0.5; + } +}; + +using LightProperties = TypeList; + class Light::Impl { public: IndexedTuple properties; diff --git a/src/mbgl/style/light_properties.hpp b/src/mbgl/style/light_properties.hpp deleted file mode 100644 index 9f6088a63..000000000 --- a/src/mbgl/style/light_properties.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace mbgl { -namespace style { - -template -class LightProperty { -public: - using Type = T; - using ValueType = PropertyValue; - - PropertyValue value; - TransitionOptions transition; -}; - -struct LightAnchor : LightProperty { - static LightAnchorType defaultValue() { - return LightAnchorType::Viewport; - } -}; - -struct LightPosition : LightProperty { - static Position defaultValue() { - std::array default_ = { { 1.15, 210, 30 } }; - return Position{ { default_ } }; - } -}; - -struct LightColor : LightProperty { - static Color defaultValue() { - return Color::white(); - } -}; - -struct LightIntensity : LightProperty { - static float defaultValue() { - return 0.5; - } -}; - -using LightProperties = TypeList; - -} // namespace style -} // namespace mbgl