summaryrefslogtreecommitdiff
path: root/src/mbgl/style/light.cpp.ejs
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-05-04 19:21:08 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-05-08 19:39:55 +0300
commit6fd40867d67eb3758c0eb8eca184ed9d7b9da5b0 (patch)
tree36fede4f7dfeb01a6835f53a185dad47f3153481 /src/mbgl/style/light.cpp.ejs
parentfeae5e22ee4910a1508f2120c8131b2f8531bae8 (diff)
downloadqtlocation-mapboxgl-6fd40867d67eb3758c0eb8eca184ed9d7b9da5b0.tar.gz
[core] delegate light changes to render light
Diffstat (limited to 'src/mbgl/style/light.cpp.ejs')
-rw-r--r--src/mbgl/style/light.cpp.ejs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/mbgl/style/light.cpp.ejs b/src/mbgl/style/light.cpp.ejs
index 7d2e0ecc1e..c82c65c10c 100644
--- a/src/mbgl/style/light.cpp.ejs
+++ b/src/mbgl/style/light.cpp.ejs
@@ -10,33 +10,36 @@
namespace mbgl {
namespace style {
+Light::Light()
+ : impl(std::make_unique<Impl>()) {
+}
+
+Light::~Light() = default;
+
<% for (const property of properties) { -%>
<%- evaluatedType(property) %> Light::getDefault<%- camelize(property.name) %>() {
return Light<%- camelize(property.name) %>::defaultValue();
}
<%- propertyValueType(property) %> Light::get<%- camelize(property.name) %>() const {
- return properties.get<Light<%- camelize(property.name) %>>().value;
+ return impl->properties.template get<Light<%- camelize(property.name) %>>().value;
}
void Light::set<%- camelize(property.name) %>(<%- propertyValueType(property) %> property) {
- properties.get<Light<%- camelize(property.name) %>>().value = property;
- if (observer) {
- observer->onLightChanged(*this);
- }
+ impl->properties.template get<Light<%- camelize(property.name) %>>().value = property;
+ impl->observer->onLightChanged(*this);
}
void Light::set<%- camelize(property.name) %>Transition(const TransitionOptions& transition) {
- properties.get<Light<%- camelize(property.name) %>>().transition = transition;
- if (observer) {
- observer->onLightChanged(*this);
- }
+ impl->properties.template get<Light<%- camelize(property.name) %>>().transition = transition;
+ impl->observer->onLightChanged(*this);
}
TransitionOptions Light::get<%- camelize(property.name) %>Transition() const {
- return properties.get<Light<%- camelize(property.name) %>>().transition;
+ return impl->properties.template get<Light<%- camelize(property.name) %>>().transition;
}
<% } -%>
+
} // namespace style
} // namespace mbgl