summaryrefslogtreecommitdiff
path: root/include/mbgl/map/mode.hpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-26 22:38:14 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-11-27 17:47:02 +0200
commit1f0820c8e82810fb957cb1cd17fb4327debfc0e5 (patch)
tree976533b4a2b03ab033143ebcd013199222c7a9ca /include/mbgl/map/mode.hpp
parent044e92f5e8ff2049702aa9ff6bbf4eecf9d86fa7 (diff)
downloadqtlocation-mapboxgl-1f0820c8e82810fb957cb1cd17fb4327debfc0e5.tar.gz
[core] Added MapDebugOptions
Map debug options are now cycled up to all debug options enabled, then back to none.
Diffstat (limited to 'include/mbgl/map/mode.hpp')
-rw-r--r--include/mbgl/map/mode.hpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/include/mbgl/map/mode.hpp b/include/mbgl/map/mode.hpp
index 8b65baf99f..0fe2c46dd8 100644
--- a/include/mbgl/map/mode.hpp
+++ b/include/mbgl/map/mode.hpp
@@ -5,7 +5,9 @@
namespace mbgl {
-enum class MapMode : uint8_t {
+using EnumType = uint32_t;
+
+enum class MapMode : EnumType {
Continuous, // continually updating map
Still, // a once-off still image
};
@@ -14,18 +16,38 @@ enum class MapMode : uint8_t {
// being shared. In a shared GL context case, we need to make sure that the
// correct GL configurations are in use - they might have changed between render
// calls.
-enum class GLContextMode : uint8_t {
+enum class GLContextMode : EnumType {
Unique,
Shared,
};
// We can choose to constrain the map both horizontally or vertically, or only
// vertically e.g. while panning.
-enum class ConstrainMode : uint8_t {
+enum class ConstrainMode : EnumType {
HeightOnly,
WidthAndHeight,
};
+enum class MapDebugOptions : EnumType {
+ NoDebug = 0,
+ TileBorders = 1 << 1,
+ ParseStatus = 1 << 2,
+ Timestamps = 1 << 3,
+};
+
+inline MapDebugOptions operator| (const MapDebugOptions& lhs, const MapDebugOptions& rhs) {
+ return MapDebugOptions(static_cast<EnumType>(lhs) | static_cast<EnumType>(rhs));
+}
+
+inline MapDebugOptions& operator|=(MapDebugOptions& lhs, const MapDebugOptions& rhs) {
+ lhs = lhs | rhs;
+ return lhs;
+}
+
+inline bool operator& (const MapDebugOptions& lhs, const MapDebugOptions& rhs) {
+ return static_cast<EnumType>(lhs) & static_cast<EnumType>(rhs);
+}
+
} // namespace mbgl
#endif // MBGL_MAP_MODE