[core] Merge light_properties.hpp into light_impl.hpp
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user