[core] Merge light_properties.hpp into light_impl.hpp

This commit is contained in:
John Firebaugh
2017-05-10 11:42:39 -07:00
parent 8fb1a81c46
commit 3fa9f3c9e8
5 changed files with 43 additions and 55 deletions

View File

@@ -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>

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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