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 /platform | |
parent | d55aa7929cb10d40a58b6b7a8ed73bddd4f0a407 (diff) | |
download | qtlocation-mapboxgl-92856f394c76f75051a72fbc5944b63cbea7ccde.tar.gz |
[core] Collision debug is now MapDebugOptions::Collision
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/jni.cpp | 26 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 4 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 9 |
3 files changed, 6 insertions, 33 deletions
diff --git a/platform/android/jni.cpp b/platform/android/jni.cpp index f3181b2a83..79281a0ade 100644 --- a/platform/android/jni.cpp +++ b/platform/android/jni.cpp @@ -1295,7 +1295,7 @@ void JNICALL nativeSetDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jb assert(nativeMapViewPtr != 0); NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); - DebugOptions debugOptions = debug ? DebugOptions::TileBorders | DebugOptions::ParseStatus + DebugOptions debugOptions = debug ? DebugOptions::TileBorders | DebugOptions::ParseStatus | DebugOptions::Collision : DebugOptions::NoDebug; nativeMapView->getMap().setDebug(debugOptions); nativeMapView->enableFps(debug); @@ -1316,27 +1316,6 @@ jboolean JNICALL nativeGetDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr return nativeMapView->getMap().getDebug() != DebugOptions::NoDebug; } -void JNICALL nativeSetCollisionDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jboolean debug) { - mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetCollisionDebug"); - assert(nativeMapViewPtr != 0); - NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); - nativeMapView->getMap().setCollisionDebug(debug); -} - -void JNICALL nativeToggleCollisionDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) { - mbgl::Log::Debug(mbgl::Event::JNI, "nativeToggleCollisionDebug"); - assert(nativeMapViewPtr != 0); - NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); - nativeMapView->getMap().toggleCollisionDebug(); -} - -jboolean JNICALL nativeGetCollisionDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) { - mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetCollisionDebug"); - assert(nativeMapViewPtr != 0); - NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); - return nativeMapView->getMap().getCollisionDebug(); -} - jboolean JNICALL nativeIsFullyLoaded(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeIsFullyLoaded"); assert(nativeMapViewPtr != 0); @@ -1955,9 +1934,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { {"nativeSetDebug", "(JZ)V", reinterpret_cast<void *>(&nativeSetDebug)}, {"nativeToggleDebug", "(J)V", reinterpret_cast<void *>(&nativeToggleDebug)}, {"nativeGetDebug", "(J)Z", reinterpret_cast<void *>(&nativeGetDebug)}, - {"nativeSetCollisionDebug", "(JZ)V", reinterpret_cast<void *>(&nativeSetCollisionDebug)}, - {"nativeToggleCollisionDebug", "(J)V", reinterpret_cast<void *>(&nativeToggleCollisionDebug)}, - {"nativeGetCollisionDebug", "(J)Z", reinterpret_cast<void *>(&nativeGetCollisionDebug)}, {"nativeIsFullyLoaded", "(J)Z", reinterpret_cast<void *>(&nativeIsFullyLoaded)}, {"nativeSetReachability", "(JZ)V", reinterpret_cast<void *>(&nativeSetReachability)}, {"nativeGetMetersPerPixelAtLatitude", "(JDD)D", reinterpret_cast<void *>(&nativeGetMetersPerPixelAtLatitude)}, diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 998eb64791..4e00722e21 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -89,7 +89,6 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_) printf("- Press `S` to cycle through bundled styles\n"); printf("- Press `X` to reset the transform\n"); printf("- Press `N` to reset north\n"); - printf("- Press `C` to toggle symbol collision debug boxes\n"); printf("- Press `R` to toggle any available `night` style class\n"); printf("\n"); printf("- Press `1` through `6` to add increasing numbers of point annotations for testing\n"); @@ -129,9 +128,6 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, case GLFW_KEY_TAB: view->map->cycleDebugOptions(); break; - case GLFW_KEY_C: - view->map->toggleCollisionDebug(); - break; case GLFW_KEY_X: if (!mods) view->map->resetPosition(); diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index d3faf8c099..ad9a7e37e8 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -12,6 +12,7 @@ #include <mbgl/annotation/shape_annotation.hpp> #include <mbgl/sprite/sprite_image.hpp> #include <mbgl/map/camera.hpp> +#include <mbgl/map/mode.hpp> #include <mbgl/platform/platform.hpp> #include <mbgl/platform/darwin/reachability.h> #include <mbgl/storage/sqlite_cache.hpp> @@ -1502,14 +1503,15 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) - (void)setDebugActive:(BOOL)debugActive { - _mbglMap->setDebug(debugActive ? mbgl::MapDebugOptions::TileBorders | mbgl::MapDebugOptions::ParseStatus + _mbglMap->setDebug(debugActive ? mbgl::MapDebugOptions::TileBorders + | mbgl::MapDebugOptions::ParseStatus + | mbgl::MapDebugOptions::Collision : mbgl::MapDebugOptions::NoDebug); - _mbglMap->setCollisionDebug(debugActive); } - (BOOL)isDebugActive { - return (_mbglMap->getDebug() != mbgl::MapDebugOptions::NoDebug || _mbglMap->getCollisionDebug()); + return (_mbglMap->getDebug() != mbgl::MapDebugOptions::NoDebug); } - (void)resetNorth @@ -1531,7 +1533,6 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) - (void)cycleDebugOptions { _mbglMap->cycleDebugOptions(); - _mbglMap->toggleCollisionDebug(); } - (void)emptyMemoryCache |