summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-22 15:18:30 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-22 15:18:30 +0200
commit087d04292a844fbfdb8d65457b1d44456e51c631 (patch)
treed8849a40764a09a53cd0920e8f5bdd87c65d9001 /include
parent905c4294be495d15591885a2438ca0b8abc8decf (diff)
parent253bbd1c5b5c5ae4a7bdbf731f58efa08d8cf855 (diff)
downloadqtlocation-mapboxgl-087d04292a844fbfdb8d65457b1d44456e51c631.tar.gz
Merge branch 'master' of github.com:mapbox/mapbox-gl-native
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/transform_state.hpp8
-rw-r--r--include/mbgl/platform/event.hpp9
-rw-r--r--include/mbgl/platform/log.hpp6
-rw-r--r--include/mbgl/style/property_key.hpp3
-rw-r--r--include/mbgl/style/style_properties.hpp1
-rw-r--r--include/mbgl/util/mat3.hpp2
6 files changed, 19 insertions, 10 deletions
diff --git a/include/mbgl/map/transform_state.hpp b/include/mbgl/map/transform_state.hpp
index 5b3b7d3755..ed49dc3e99 100644
--- a/include/mbgl/map/transform_state.hpp
+++ b/include/mbgl/map/transform_state.hpp
@@ -29,10 +29,16 @@ public:
const std::array<uint16_t, 2> getFramebufferDimensions() const;
float getPixelRatio() const;
+ float worldSize() const;
+ float lngX(float lon) const;
+ float latY(float lat) const;
+ std::array<float, 2> locationCoordinate(float lon, float lat) const;
+
// Zoom
float getNormalizedZoom() const;
- int32_t getIntegerZoom() const;
double getZoom() const;
+ int32_t getIntegerZoom() const;
+ double getZoomFraction() const;
double getScale() const;
// Rotation
diff --git a/include/mbgl/platform/event.hpp b/include/mbgl/platform/event.hpp
index 0405cddfad..2aa4aa0c95 100644
--- a/include/mbgl/platform/event.hpp
+++ b/include/mbgl/platform/event.hpp
@@ -57,14 +57,13 @@ struct EventPermutation {
}
};
-#if !DEBUG
constexpr EventSeverity disabledEventSeverities[] = {
- EventSeverity::Debug,
-};
+#if DEBUG
+ EventSeverity(-1) // Avoid zero size array
#else
-constexpr EventSeverity *disabledEventSeverities = nullptr;
+ EventSeverity::Debug
#endif
-
+};
constexpr Event disabledEvents[] = {
Event(-1) // Avoid zero size array
diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp
index bcb6d79224..406b3eea37 100644
--- a/include/mbgl/platform/log.hpp
+++ b/include/mbgl/platform/log.hpp
@@ -19,9 +19,9 @@ public:
class Log {
private:
- template <typename T>
- constexpr static bool includes(const T e, T const *l, const size_t i = 0) {
- return l == nullptr ? false : i >= sizeof l ? false : *(l + i) == e ? true : includes(e, l, i + 1);
+ template <typename T, size_t N>
+ constexpr static bool includes(const T e, const T (&l)[N], const size_t i = 0) {
+ return i < N && (l[i] == e || includes(e, l, i + 1));
}
public:
diff --git a/include/mbgl/style/property_key.hpp b/include/mbgl/style/property_key.hpp
index 28aa800607..cbf9ad2ac5 100644
--- a/include/mbgl/style/property_key.hpp
+++ b/include/mbgl/style/property_key.hpp
@@ -61,7 +61,8 @@ enum class PropertyKey {
RasterFade,
BackgroundOpacity,
- BackgroundColor
+ BackgroundColor,
+ BackgroundImage
};
}
diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp
index 20200a0dd7..0a5e993411 100644
--- a/include/mbgl/style/style_properties.hpp
+++ b/include/mbgl/style/style_properties.hpp
@@ -94,6 +94,7 @@ struct BackgroundProperties {
inline BackgroundProperties() {}
float opacity = 1.0f;
Color color = {{ 0, 0, 0, 1 }};
+ std::string image;
};
typedef mapbox::util::variant<
diff --git a/include/mbgl/util/mat3.hpp b/include/mbgl/util/mat3.hpp
index d44b1435d3..fa40751764 100644
--- a/include/mbgl/util/mat3.hpp
+++ b/include/mbgl/util/mat3.hpp
@@ -32,6 +32,8 @@ typedef std::array<float, 9> mat3;
namespace matrix {
void identity(mat3& out);
+void translate(mat3& out, const mat3& a, float x, float y);
+void rotate(mat3& out, const mat3& a, float rad);
void scale(mat3& out, const mat3& a, float x, float y);
}