diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-11-27 10:44:14 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-11-27 17:47:02 +0200 |
commit | 92856f394c76f75051a72fbc5944b63cbea7ccde (patch) | |
tree | 7b6a871fff41a33b37733a7fd49294ffc3d21821 /src/mbgl/map | |
parent | d55aa7929cb10d40a58b6b7a8ed73bddd4f0a407 (diff) | |
download | qtlocation-mapboxgl-92856f394c76f75051a72fbc5944b63cbea7ccde.tar.gz |
[core] Collision debug is now MapDebugOptions::Collision
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/map.cpp | 14 | ||||
-rw-r--r-- | src/mbgl/map/map_data.hpp | 15 | ||||
-rw-r--r-- | src/mbgl/map/source.cpp | 4 |
3 files changed, 5 insertions, 28 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 573500fd65..57f8c3e7f3 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -434,20 +434,6 @@ MapDebugOptions Map::getDebug() const { return data->getDebug(); } -void Map::setCollisionDebug(bool value) { - data->setCollisionDebug(value); - update(Update::Repaint); -} - -void Map::toggleCollisionDebug() { - data->toggleCollisionDebug(); - update(Update::Repaint); -} - -bool Map::getCollisionDebug() const { - return data->getCollisionDebug(); -} - bool Map::isFullyLoaded() const { return context->invokeSync<bool>(&MapContext::isLoaded); } diff --git a/src/mbgl/map/map_data.hpp b/src/mbgl/map/map_data.hpp index 9b02d372de..d8c1e5cb0d 100644 --- a/src/mbgl/map/map_data.hpp +++ b/src/mbgl/map/map_data.hpp @@ -55,8 +55,10 @@ public: } inline void cycleDebugOptions() { - if (debugOptions & MapDebugOptions::Timestamps) + if (debugOptions & MapDebugOptions::Collision) debugOptions = MapDebugOptions::NoDebug; + else if (debugOptions & MapDebugOptions::Timestamps) + debugOptions = debugOptions | MapDebugOptions::Collision; else if (debugOptions & MapDebugOptions::ParseStatus) debugOptions = debugOptions | MapDebugOptions::Timestamps; else if (debugOptions & MapDebugOptions::TileBorders) @@ -69,16 +71,6 @@ public: debugOptions = debugOptions_; } - inline bool getCollisionDebug() const { - return collisionDebug; - } - inline bool toggleCollisionDebug() { - return collisionDebug ^= 1u; - } - inline void setCollisionDebug(bool value) { - collisionDebug = value; - } - inline TimePoint getAnimationTime() const { // We're casting the TimePoint to and from a Duration because libstdc++ // has a bug that doesn't allow TimePoints to be atomic. @@ -147,7 +139,6 @@ private: std::vector<std::string> classes; std::atomic<MapDebugOptions> debugOptions { MapDebugOptions::NoDebug }; - std::atomic<uint8_t> collisionDebug { false }; std::atomic<Duration> animationTime; std::atomic<Duration> defaultFadeDuration; std::atomic<Duration> defaultTransitionDuration; diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp index 62014bd05d..4e8e60de51 100644 --- a/src/mbgl/map/source.cpp +++ b/src/mbgl/map/source.cpp @@ -519,7 +519,7 @@ bool Source::update(const TransformState& transformState, for (auto& tilePtr : tilePtrs) { tilePtr->data->redoPlacement( - { transformState.getAngle(), transformState.getPitch(), data.getCollisionDebug() }); + { transformState.getAngle(), transformState.getPitch(), data.getDebug() & MapDebugOptions::Collision }); } updated = data.getAnimationTime(); @@ -562,7 +562,7 @@ void Source::tileLoadingCompleteCallback(const TileID& normalized_id, const Tran return; } - tileData->redoPlacement({ transformState.getAngle(), transformState.getPitch(), data.getCollisionDebug() }); + tileData->redoPlacement({ transformState.getAngle(), transformState.getPitch(), data.getDebug() & MapDebugOptions::Collision}); emitTileLoaded(true); } |