diff options
-rw-r--r-- | android/cpp/jni.cpp | 730 | ||||
-rw-r--r-- | android/cpp/native_map_view.cpp | 150 | ||||
-rw-r--r-- | android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java | 8 | ||||
-rw-r--r-- | include/mbgl/android/jni.hpp | 40 | ||||
-rw-r--r-- | include/mbgl/android/native_map_view.hpp | 14 | ||||
-rw-r--r-- | include/mbgl/platform/android/log_android.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/platform/default/headless_view.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/platform/gl.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/renderer/prerendered_texture.hpp | 6 | ||||
-rw-r--r-- | platform/android/asset_request_baton_libzip.cpp | 30 | ||||
-rw-r--r-- | platform/android/cache_database_data.cpp | 2 | ||||
-rw-r--r-- | platform/android/log_android.cpp | 12 | ||||
-rw-r--r-- | platform/default/headless_view.cpp | 8 | ||||
-rw-r--r-- | platform/default/http_request_baton_curl.cpp | 24 | ||||
-rw-r--r-- | src/platform/gl.cpp | 4 | ||||
-rw-r--r-- | src/renderer/prerendered_texture.cpp | 62 |
16 files changed, 549 insertions, 549 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index f08964a546..de3c64c04f 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -35,35 +35,35 @@ namespace mbgl { namespace android { -std::string cache_path; -std::string data_path; -std::string apk_path; +std::string cachePath; +std::string dataPath; +std::string apkPath; -jmethodID on_map_changed_id = nullptr; -jmethodID on_fps_changed_id = nullptr; +jmethodID onMapChangedId = nullptr; +jmethodID onFpsChangedId = nullptr; -jclass lon_lat_class = nullptr; -jmethodID lon_lat_constructor_id = nullptr; -jfieldID lon_lat_lon_id = nullptr; -jfieldID lon_lat_lat_id = nullptr; +jclass lonLatClass = nullptr; +jmethodID lonLatConstructorId = nullptr; +jfieldID lonLatLonId = nullptr; +jfieldID lonLatLatId = nullptr; -jclass lon_lat_zoom_class = nullptr; -jmethodID lon_lat_zoom_constructor_id = nullptr; -jfieldID lon_lat_zoom_lon_id = nullptr; -jfieldID lon_lat_zoom_lat_id = nullptr; -jfieldID lon_lat_zoom_zoom_id = nullptr; +jclass lonLatZoomClass = nullptr; +jmethodID lonLatZoomConstructorId = nullptr; +jfieldID lonLatZoomLonId = nullptr; +jfieldID lonLatZoomLatId = nullptr; +jfieldID lonLatZoomZoomId = nullptr; -jclass runtime_exception_class = nullptr; -jclass null_pointer_exception_class = nullptr; +jclass runtimeExceptionClass = nullptr; +jclass nullPointerExceptionClass = nullptr; -jmethodID list_to_array_id = nullptr; +jmethodID listToArrayId = nullptr; -jclass array_list_class = nullptr; -jmethodID array_list_constructor_id = nullptr; -jmethodID array_list_add_id = nullptr; +jclass arrayListClass = nullptr; +jmethodID arraylistConstructorId = nullptr; +jmethodID arrayListAddId = nullptr; bool throw_error(JNIEnv* env, const char* msg) { - if (env->ThrowNew(runtime_exception_class, msg) < 0) { + if (env->ThrowNew(runtimeExceptionClass, msg) < 0) { env->ExceptionDescribe(); return false; } @@ -75,7 +75,7 @@ std::string std_string_from_jstring(JNIEnv* env, jstring jstr) { std::string str; if (jstr == nullptr) { - if (env->ThrowNew(null_pointer_exception_class, "String cannot be null.") < 0) { + if (env->ThrowNew(nullPointerExceptionClass, "String cannot be null.") < 0) { env->ExceptionDescribe(); return str; } @@ -118,7 +118,7 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli std::vector<std::string> vector; if (jlist == nullptr) { - if (env->ThrowNew(null_pointer_exception_class, "List cannot be null.") < 0) { + if (env->ThrowNew(nullPointerExceptionClass, "List cannot be null.") < 0) { env->ExceptionDescribe(); return vector; } @@ -126,7 +126,7 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli return vector; } - jobjectArray array = reinterpret_cast<jobjectArray>(env->CallObjectMethod(jlist, list_to_array_id)); + jobjectArray array = reinterpret_cast<jobjectArray>(env->CallObjectMethod(jlist, listToArrayId)); if (env->ExceptionCheck() || (array == nullptr)) { env->ExceptionDescribe(); return vector; @@ -152,14 +152,14 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli } jobject std_vector_string_to_jobject(JNIEnv* env, std::vector<std::string> vector) { - jobject jlist = env->NewObject(array_list_class, array_list_constructor_id); + jobject jlist = env->NewObject(arrayListClass, arrayListConstructorId); if (jlist == nullptr) { env->ExceptionDescribe(); return nullptr; } for (std::string str : vector) { - env->CallBooleanMethod(jlist, array_list_add_id, std_string_to_jstring(env, str)); + env->CallBooleanMethod(jlist, arrayListAddId, std_string_to_jstring(env, str)); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return nullptr; @@ -176,302 +176,302 @@ namespace { using namespace mbgl::android; -jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cache_path_, jstring data_path_, jstring apk_path_) { +jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cachePath_, jstring dataPath_, jstring apkPath_) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreate"); - cache_path = std_string_from_jstring(env, cache_path_); - data_path = std_string_from_jstring(env, data_path_); - apk_path = std_string_from_jstring(env, apk_path_); - NativeMapView* native_map_view = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view = new NativeMapView(env, obj))); - if (native_map_view == nullptr) { + cachePath = std_string_from_jstring(env, cachePath_); + dataPath = std_string_from_jstring(env, dataPath_); + apkPath = std_string_from_jstring(env, apkPath_); + NativeMapView* nativeMapView = nullptr; + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView = new NativeMapView(env, obj))); + if (nativeMapView == nullptr) { throw_error(env, "Unable to create NativeMapView."); return 0; } - jlong map_view_ptr = reinterpret_cast<jlong>(native_map_view); - return map_view_ptr; + jlong mapViewPtr = reinterpret_cast<jlong>(nativeMapView); + return mapViewPtr; } -void JNICALL nativeDestroy(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeDestroy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeDestroy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - delete native_map_view; - native_map_view = nullptr; + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + delete nativeMapView; + nativeMapView = nullptr; } -void JNICALL nativeInitializeDisplay(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeInitializeDisplay(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeInitializeDisplay"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->initializeDisplay())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->initializeDisplay())); if (!ret) { throw_error(env, "Unable to initialize GL display."); } } -void JNICALL nativeTerminateDisplay(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminateDisplay(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminateDisplay"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->terminateDisplay())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->terminateDisplay())); } -void JNICALL nativeInitializeContext(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeInitializeContext(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeInitializeContext"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->initializeContext())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->initializeContext())); if (!ret) { throw_error(env, "Unable to initialize GL context."); } } -void JNICALL nativeTerminateContext(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminateContext(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminateContext"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->terminateContext())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->terminateContext())); } -void JNICALL nativeCreateSurface(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject surface) { +void JNICALL nativeCreateSurface(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject surface) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreateSurface"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->createSurface(ANativeWindow_fromSurface(env, surface)))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->createSurface(ANativeWindow_fromSurface(env, surface)))); if (!ret) { throw_error(env, "Unable to create GL surface."); } } -void JNICALL nativeDestroySurface(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeDestroySurface(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeDestroySurface"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->destroySurface())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->destroySurface())); } -void JNICALL nativeStart(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStart(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStart"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->start())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->start())); } -void JNICALL nativeStop(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStop(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStop"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->stop())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->stop())); } -void JNICALL nativePause(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativePause(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativePause"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->pause())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->pause())); } -void JNICALL nativeResume(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResume(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResume"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->resume())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->resume())); } -void JNICALL nativeRun(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeRun(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRun"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().run())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().run())); } -void JNICALL nativeRerender(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeRerender(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRerender"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().rerender())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().rerender())); } -void JNICALL nativeUpdate(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeUpdate(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeUpdate"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().update())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().update())); } -void JNICALL nativeCleanup(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeCleanup(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCleanup"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().cleanup())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().cleanup())); } -void JNICALL nativeTerminate(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminate(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminate"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().terminate())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().terminate())); } -jboolean JNICALL nativeNeedsSwap(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jboolean JNICALL nativeNeedsSwap(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeNeedsSwap"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jboolean ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().needsSwap())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().needsSwap())); return ret; } -void JNICALL nativeSwapped(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeSwapped(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSwapped"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, (native_map_view->getMap().swapped()))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, (nativeMapView->getMap().swapped()))); } -void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jint width, jint height, jfloat ratio) { +void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jint width, jint height, jfloat ratio) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResize"); - assert(native_map_view_ptr != 0); + assert(nativeMapViewPtr != 0); assert(width >= 0); assert(height >= 0); assert(width <= UINT16_MAX); assert(height <= UINT16_MAX); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resize(width, height, ratio))); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resize(width, height, ratio))); } -void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jint width, jint height, jfloat ratio, jint fb_width, jint fb_height) { +void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jint width, jint height, jfloat ratio, jint fbWidth, jint fbHeight) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResize"); - assert(native_map_view_ptr != 0); + assert(nativeMapViewPtr != 0); assert(width >= 0); assert(height >= 0); assert(width <= UINT16_MAX); assert(height <= UINT16_MAX); - assert(fb_width >= 0); - assert(fb_height >= 0); - assert(fb_width <= UINT16_MAX); - assert(fb_height <= UINT16_MAX); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resize(width, height, ratio, fb_width, fb_height))); + assert(fbWidth >= 0); + assert(fbHeight >= 0); + assert(fbWidth <= UINT16_MAX); + assert(fbHeight <= UINT16_MAX); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resize(width, height, ratio, fbWidth, fbHeight))); } -void JNICALL nativeSetAppliedClasses(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject classes) { +void JNICALL nativeSetAppliedClasses(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject classes) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetAppliedClasses"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setAppliedClasses(std_vector_string_from_jobject(env, classes)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setAppliedClasses(std_vector_string_from_jobject(env, classes)))); } -jobject JNICALL nativeGetAppliedClasses(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetAppliedClasses(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetAppliedClasses"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jobject ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_vector_string_to_jobject(env, native_map_view->getMap().getAppliedClasses()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_vector_string_to_jobject(env, nativeMapView->getMap().getAppliedClasses()))); return ret; } -void JNICALL nativeSetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jlong duration_milliseconds) { +void JNICALL nativeSetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jlong milliseconds) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetDefaultTransitionDuration"); - assert(native_map_view_ptr != 0); - assert(duration_milliseconds >= 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setDefaultTransitionDuration(duration_milliseconds))); + assert(nativeMapViewPtr != 0); + assert(milliseconds >= 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setDefaultTransitionDuration(milliseconds))); } -jlong JNICALL nativeGetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jlong JNICALL nativeGetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetDefaultTransitionDuration"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jlong ret = 0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getDefaultTransitionDuration())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getDefaultTransitionDuration())); return ret; } -void JNICALL nativeSetStyleURL(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring url) { +void JNICALL nativeSetStyleURL(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring url) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetStyleURL"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setStyleURL(std_string_from_jstring(env, url)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setStyleURL(std_string_from_jstring(env, url)))); } -void JNICALL nativeSetStyleJSON(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring new_style_json, jstring base) { +void JNICALL nativeSetStyleJSON(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring newStyleJson, jstring base) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetStyleJSON"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setStyleJSON(std_string_from_jstring(env, new_style_json), std_string_from_jstring(env, base)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setStyleJSON(std_string_from_jstring(env, newStyleJson), std_string_from_jstring(env, base)))); } -jstring JNICALL nativeGetStyleJSON(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jstring JNICALL nativeGetStyleJSON(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetStyleJSON"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jstring ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, native_map_view->getMap().getStyleJSON()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, nativeMapView->getMap().getStyleJSON()))); return ret; } -void JNICALL nativeSetAccessToken(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring access_token) { +void JNICALL nativeSetAccessToken(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring accessToken) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetAccessToken"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setAccessToken(std_string_from_jstring(env, access_token)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setAccessToken(std_string_from_jstring(env, accessToken)))); } -jstring JNICALL nativeGetAccessToken(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jstring JNICALL nativeGetAccessToken(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetAccessToken"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jstring ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, native_map_view->getMap().getAccessToken()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, nativeMapView->getMap().getAccessToken()))); return ret; } -void JNICALL nativeCancelTransitions(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeCancelTransitions(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCancelTransitions"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().cancelTransitions())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().cancelTransitions())); } -void JNICALL nativeMoveBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble dx, jdouble dy, jdouble duration) { +void JNICALL nativeMoveBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble dx, jdouble dy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeMoveBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().moveBy(dx, dy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().moveBy(dx, dy, duration))); } -void JNICALL nativeSetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject lon_lat, jdouble duration) { +void JNICALL nativeSetLonLat(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject lonLat, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetLonLat"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); - double lon = env->GetDoubleField(lon_lat, lon_lat_lon_id); + double lon = env->GetDoubleField(lonLat, lonLatLonId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double lat = env->GetDoubleField(lon_lat, lon_lat_lat_id); + double lat = env->GetDoubleField(lonLat, lonLatLatId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setLonLat(lon, lat, duration))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setLonLat(lon, lat, duration))); } -jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetLonLat"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); double lon = 0.0, lat = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().getLonLat(lon, lat))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().getLonLat(lon, lat))); - jobject ret = env->NewObject(lon_lat_class, lon_lat_constructor_id, lon, lat); + jobject ret = env->NewObject(lonLatClass, lonLatConstructorId, lon, lat); if (ret == nullptr) { env->ExceptionDescribe(); return nullptr; @@ -480,100 +480,100 @@ jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ return ret; } -void JNICALL nativeStartPanning(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartPanning(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartPanning"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startPanning())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startPanning())); } -void JNICALL nativeStopPanning(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopPanning(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopPanning"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopPanning())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopPanning())); } -void JNICALL nativeResetPosition(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetPosition(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetPosition"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetPosition())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetPosition())); } -void JNICALL nativeScaleBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble ds, jdouble cx, jdouble cy, jdouble duration) { +void JNICALL nativeScaleBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble ds, jdouble cx, jdouble cy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeScaleBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().scaleBy(ds, cx, cy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().scaleBy(ds, cx, cy, duration))); } -void JNICALL nativeSetScale(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble scale, jdouble cx, jdouble cy, jdouble duration) { +void JNICALL nativeSetScale(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble scale, jdouble cx, jdouble cy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetScale"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setScale(scale, cx, cy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setScale(scale, cx, cy, duration))); } -jdouble JNICALL nativeGetScale(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetScale(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetScale"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getScale())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getScale())); return ret; } -void JNICALL nativeSetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble zoom, jdouble duration) { +void JNICALL nativeSetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble zoom, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setZoom(zoom, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setZoom(zoom, duration))); } -jdouble JNICALL nativeGetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getZoom())); return ret; } -void JNICALL nativeSetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject lon_lat_zoom, jdouble duration) { +void JNICALL nativeSetLonLatZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject lonLatZoom, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetLonLatZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); - double lon = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_lon_id); + double lon = env->GetDoubleField(lonLatZoom, lonLatZoomLonId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double lat = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_lat_id); + double lat = env->GetDoubleField(lonLatZoom, lonLatZoomLatId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double zoom = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_zoom_id); + double zoom = env->GetDoubleField(lonLatZoom, lonLatZoomZoomId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setLonLatZoom(lon, lat, zoom, duration))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setLonLatZoom(lon, lat, zoom, duration))); } -jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetLonLatZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); double lon = 0.0, lat = 0.0, zoom = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().getLonLatZoom(lon, lat, zoom))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().getLonLatZoom(lon, lat, zoom))); - jobject ret = env->NewObject(lon_lat_zoom_class, lon_lat_zoom_constructor_id, lon, lat, zoom); + jobject ret = env->NewObject(lonLatZoomClass, lonLatZoomConstructorId, lon, lat, zoom); if (ret == nullptr) { env->ExceptionDescribe(); return nullptr; @@ -582,124 +582,124 @@ jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_v return ret; } -void JNICALL nativeResetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetZoom())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetZoom())); } -void JNICALL nativeStartScaling(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartScaling(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartScaling"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startScaling())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startScaling())); } -void JNICALL nativeStopScaling(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopScaling(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopScaling"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopScaling())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopScaling())); } -jdouble JNICALL nativeGetMinZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetMinZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetMinZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getMinZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getMinZoom())); return ret; } -jdouble JNICALL nativeGetMaxZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetMaxZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetMaxZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getMaxZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getMaxZoom())); return ret; } -void JNICALL nativeRotateBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble sx, jdouble sy, jdouble ex, jdouble ey, jdouble duration) { +void JNICALL nativeRotateBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble sx, jdouble sy, jdouble ex, jdouble ey, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRotateBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().rotateBy(sx, sy, ex, ey, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().rotateBy(sx, sy, ex, ey, duration))); } -void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble degrees, jdouble duration) { +void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble degrees, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setBearing(degrees, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setBearing(degrees, duration))); } -void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble degrees, jdouble cx, jdouble cy) { +void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble degrees, jdouble cx, jdouble cy) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setBearing(degrees, cx, cy))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setBearing(degrees, cx, cy))); } -jdouble JNICALL nativeGetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getBearing())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getBearing())); return ret; } -void JNICALL nativeResetNorth(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetNorth(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetNorth"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetNorth())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetNorth())); } -void JNICALL nativeStartRotating(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartRotating(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartRotating"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startRotating())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startRotating())); } -void JNICALL nativeStopRotating(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopRotating(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopRotating"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopRotating())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopRotating())); } -void JNICALL nativeSetDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jboolean debug) { +void JNICALL nativeSetDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jboolean debug) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setDebug(debug); native_map_view->enableFps(debug))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setDebug(debug); nativeMapView->enableFps(debug))); } -void JNICALL nativeToggleDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeToggleDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeToggleDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().toggleDebug(); native_map_view->enableFps(native_map_view->getMap().getDebug()))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().toggleDebug(); nativeMapView->enableFps(nativeMapView->getMap().getDebug()))); } -jboolean JNICALL nativeGetDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jboolean JNICALL nativeGetDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jboolean ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getDebug())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getDebug())); return ret; } -void JNICALL nativeSetReachability(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jboolean status) { +void JNICALL nativeSetReachability(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jboolean status) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetReachability"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setReachability(status))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setReachability(status))); } } @@ -718,116 +718,116 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } - lon_lat_class = env->FindClass("com/mapbox/mapboxgl/lib/LonLat"); - if (lon_lat_class == nullptr) { + lonLatClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLat"); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_constructor_id = env->GetMethodID(lon_lat_class, "<init>", "(DD)V"); - if (lon_lat_constructor_id == nullptr) { + lonLatConstructorId = env->GetMethodID(lonLatClass, "<init>", "(DD)V"); + if (lonLatConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_lon_id = env->GetFieldID(lon_lat_class, "lon", "D"); - if (lon_lat_lon_id == nullptr) { + lonLatLonId = env->GetFieldID(lonLatClass, "lon", "D"); + if (lonLatLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_lat_id = env->GetFieldID(lon_lat_class, "lat", "D"); - if (lon_lat_lat_id == nullptr) { + lonLatLatId = env->GetFieldID(lonLatClass, "lat", "D"); + if (lonLatLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_class = env->FindClass("com/mapbox/mapboxgl/lib/LonLatZoom"); - if (lon_lat_class == nullptr) { + lonLatZoomClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLatZoom"); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_constructor_id = env->GetMethodID(lon_lat_zoom_class, "<init>", "(DDD)V"); - if (lon_lat_zoom_constructor_id == nullptr) { + lonLatZoomConstructorId = env->GetMethodID(lonLatZoomClass, "<init>", "(DDD)V"); + if (lonLatZoomConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_lon_id = env->GetFieldID(lon_lat_zoom_class, "lon", "D"); - if (lon_lat_zoom_lon_id == nullptr) { + lonLatZoomLonId = env->GetFieldID(lonLatZoomClass, "lon", "D"); + if (lonLatZoomLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_lat_id = env->GetFieldID(lon_lat_zoom_class, "lat", "D"); - if (lon_lat_zoom_lat_id == nullptr) { + lonLatZoomLatId = env->GetFieldID(lonLatZoomClass, "lat", "D"); + if (lonLatZoomLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_zoom_id = env->GetFieldID(lon_lat_zoom_class, "zoom", "D"); - if (lon_lat_zoom_zoom_id == nullptr) { + lonLatZoomZoomId = env->GetFieldID(lonLatZoomClass, "zoom", "D"); + if (lonLatZoomZoomId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - jclass native_map_view_class = env->FindClass("com/mapbox/mapboxgl/lib/NativeMapView"); - if (native_map_view_class == nullptr) { + jclass nativeMapViewClass = env->FindClass("com/mapbox/mapboxgl/lib/NativeMapView"); + if (nativeMapViewClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - on_map_changed_id = env->GetMethodID(native_map_view_class, "onMapChanged", "()V"); - if (on_map_changed_id == nullptr) { + onMapChangedId = env->GetMethodID(nativeMapViewClass, "onMapChanged", "()V"); + if (onMapChangedId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - on_fps_changed_id = env->GetMethodID(native_map_view_class, "onFpsChanged", "(D)V"); - if (on_fps_changed_id == nullptr) { + onFpsChangedId = env->GetMethodID(nativeMapViewClass, "onFpsChanged", "(D)V"); + if (onFpsChangedId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - runtime_exception_class = env->FindClass("java/lang/RuntimeException"); - if (runtime_exception_class == nullptr) { + runtimeExceptionClass = env->FindClass("java/lang/RuntimeException"); + if (runtimeExceptionClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - null_pointer_exception_class = env->FindClass("java/lang/NullPointerException"); - if (null_pointer_exception_class == nullptr) { + nullPointerExceptionClass = env->FindClass("java/lang/NullPointerException"); + if (nullPointerExceptionClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - jclass list_class = env->FindClass("java/util/List"); - if (list_class == nullptr) { + jclass listClass = env->FindClass("java/util/List"); + if (listClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - list_to_array_id = env->GetMethodID(list_class, "toArray", "()[Ljava/lang/Object;"); - if (list_to_array_id == nullptr) { + listToArrayId = env->GetMethodID(listClass, "toArray", "()[Ljava/lang/Object;"); + if (listToArrayId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_class = env->FindClass("java/util/ArrayList"); - if (array_list_class == nullptr) { + arrayListClass = env->FindClass("java/util/ArrayList"); + if (arrayListClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_constructor_id = env->GetMethodID(array_list_class, "<init>", "()V"); - if (array_list_constructor_id == nullptr) { + arrayListConstructorId = env->GetMethodID(arrayListClass, "<init>", "()V"); + if (arrayListConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_add_id = env->GetMethodID(array_list_class, "add", "(Ljava/lang/Object;)Z"); - if (array_list_add_id == nullptr) { + arrayListAddId = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + if (arrayListAddId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } @@ -896,48 +896,48 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { { "nativeSetReachability", "(JZ)V", reinterpret_cast<void*>(&nativeSetReachability) } }}; - if (env->RegisterNatives(native_map_view_class, methods.data(), methods.size()) < 0) { + if (env->RegisterNatives(nativeMapViewClass, methods.data(), methods.size()) < 0) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_class = reinterpret_cast<jclass>(env->NewGlobalRef(lon_lat_class)); - if (lon_lat_class == nullptr) { + lonLatClass = reinterpret_cast<jclass>(env->NewGlobalRef(lonLatClass)); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_class = reinterpret_cast<jclass>(env->NewGlobalRef(lon_lat_zoom_class)); - if (lon_lat_zoom_class == nullptr) { + lonLatZoomClass = reinterpret_cast<jclass>(env->NewGlobalRef(lonLatZoomClass)); + if (lonLatZoomClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); + env->DeleteGlobalRef(lonLatClass); return JNI_ERR; } - runtime_exception_class = reinterpret_cast<jclass>(env->NewGlobalRef(runtime_exception_class)); - if (runtime_exception_class == nullptr) { + runtimeExceptionClass = reinterpret_cast<jclass>(env->NewGlobalRef(runtimeExceptionClass)); + if (runtimeExceptionClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); return JNI_ERR; } - null_pointer_exception_class = reinterpret_cast<jclass>(env->NewGlobalRef(null_pointer_exception_class)); - if (runtime_exception_class == nullptr) { + nullPointerExceptionClass = reinterpret_cast<jclass>(env->NewGlobalRef(nullPointerExceptionClass)); + if (nullPointerExceptionClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); - env->DeleteGlobalRef(runtime_exception_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); + env->DeleteGlobalRef(runtimeExceptionClass); return JNI_ERR; } - array_list_class = reinterpret_cast<jclass>(env->NewGlobalRef(array_list_class)); - if (array_list_class == nullptr) { + arrayListClass = reinterpret_cast<jclass>(env->NewGlobalRef(arrayListClass)); + if (arrayListClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); - env->DeleteGlobalRef(runtime_exception_class); - env->DeleteGlobalRef(null_pointer_exception_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); + env->DeleteGlobalRef(runtimeExceptionClass); + env->DeleteGlobalRef(nullPointerExceptionClass); return JNI_ERR; } @@ -954,34 +954,34 @@ extern "C" JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { return; } - env->DeleteGlobalRef(lon_lat_class); - lon_lat_class = nullptr; - lon_lat_constructor_id = nullptr; - lon_lat_lon_id = nullptr; - lon_lat_lat_id = nullptr; + env->DeleteGlobalRef(lonLatClass); + lonLatClass = nullptr; + lonLatConstructorId = nullptr; + lonLatLonId = nullptr; + lonLatLatId = nullptr; - env->DeleteGlobalRef(lon_lat_zoom_class); - lon_lat_zoom_class = nullptr; - lon_lat_zoom_constructor_id = nullptr; - lon_lat_zoom_lon_id = nullptr; - lon_lat_zoom_lat_id = nullptr; - lon_lat_zoom_zoom_id = nullptr; + env->DeleteGlobalRef(lonLatZoomClass); + lonLatZoomClass = nullptr; + lonLatZoomConstructorId = nullptr; + lonLatZoomLonId = nullptr; + lonLatZoomLatId = nullptr; + lonLatZoomZoomId = nullptr; - on_map_changed_id = nullptr; - on_fps_changed_id = nullptr; + onMapChangedId = nullptr; + onFpsChangedId = nullptr; - env->DeleteGlobalRef(runtime_exception_class); - runtime_exception_class = nullptr; + env->DeleteGlobalRef(runtimeExceptionClass); + runtimeExceptionClass = nullptr; - env->DeleteGlobalRef(null_pointer_exception_class); - null_pointer_exception_class = nullptr; + env->DeleteGlobalRef(nullPointerExceptionClass); + nullPointerExceptionClass = nullptr; - list_to_array_id = nullptr; + listToArrayId = nullptr; - env->DeleteGlobalRef(array_list_class); - array_list_class = nullptr; - array_list_constructor_id = nullptr; - array_list_add_id = nullptr; + env->DeleteGlobalRef(arrayListClass); + arrayListClass = nullptr; + arrayListConstructorId = nullptr; + arrayListAddId = nullptr; } } diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp index 58e11b425c..1e387e0fa0 100644 --- a/android/cpp/native_map_view.cpp +++ b/android/cpp/native_map_view.cpp @@ -161,13 +161,13 @@ bool NativeMapView::initializeDisplay() { // Detect if we are in emulator char prop[PROP_VALUE_MAX]; __system_property_get("ro.kernel.qemu", prop); - bool in_emulator = strtol(prop, nullptr, 0) == 1; - if (in_emulator) { + bool inEmulator = strtol(prop, nullptr, 0) == 1; + if (inEmulator) { mbgl::Log::Warning(mbgl::Event::Android, "In emulator! Enabling hacks :-("); } // Get all configs at least RGB 565 with 16 depth and 8 stencil - EGLint config_attribs[] = { + EGLint configAttribs[] = { EGL_CONFIG_CAVEAT, EGL_NONE, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, @@ -177,30 +177,30 @@ bool NativeMapView::initializeDisplay() { EGL_BLUE_SIZE, 5, EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, - (in_emulator ? EGL_NONE : EGL_CONFORMANT), EGL_OPENGL_ES2_BIT, // Ugly hack - (in_emulator ? EGL_NONE : EGL_COLOR_BUFFER_TYPE), EGL_RGB_BUFFER, // Ugly hack + (inEmulator ? EGL_NONE : EGL_CONFORMANT), EGL_OPENGL_ES2_BIT, // Ugly hack + (inEmulator ? EGL_NONE : EGL_COLOR_BUFFER_TYPE), EGL_RGB_BUFFER, // Ugly hack EGL_NONE }; - EGLint num_configs; - if (!eglChooseConfig(display, config_attribs, nullptr, 0, &num_configs)) { + EGLint numConfigs; + if (!eglChooseConfig(display, configAttribs, nullptr, 0, &numConfigs)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig(NULL) returned error %d", eglGetError()); terminateDisplay(); return false; } - if (num_configs < 1) { + if (numConfigs < 1) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned no configs."); terminateDisplay(); return false; } - const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(num_configs); - if (!eglChooseConfig(display, config_attribs, configs.get(), num_configs, &num_configs)) { + const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(numConfigs); + if (!eglChooseConfig(display, configAttribs, configs.get(), numConfigs, &numConfigs)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError()); terminateDisplay(); return false; } - config = chooseConfig(configs.get(), num_configs); + config = chooseConfig(configs.get(), numConfigs); if (config == nullptr) { mbgl::Log::Error(mbgl::Event::OpenGL, "No config chosen"); terminateDisplay(); @@ -251,11 +251,11 @@ bool NativeMapView::initializeContext() { assert(context == EGL_NO_CONTEXT); assert(config != nullptr); - const EGLint context_attribs[] = { + const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; - context = eglCreateContext(display, config, EGL_NO_CONTEXT, context_attribs); + context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs); if (context == EGL_NO_CONTEXT) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglCreateContext() returned error %d", eglGetError()); terminateContext(); @@ -267,8 +267,8 @@ bool NativeMapView::initializeContext() { void NativeMapView::terminateContext() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::terminateContext"); - if (display != EGL_NO_DISPLAY) { + if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError()); @@ -298,18 +298,18 @@ bool NativeMapView::createSurface(ANativeWindow* window_) { ANativeWindow_setBuffersGeometry(window, 0, 0, format); - const EGLint surface_attribs[] = { + const EGLint surfaceAttribs[] = { EGL_NONE }; - surface = eglCreateWindowSurface(display, config, window, surface_attribs); + surface = eglCreateWindowSurface(display, config, window, surfaceAttribs); if (surface == EGL_NO_SURFACE) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglCreateWindowSurface() returned error %d", eglGetError()); destroySurface(); return false; } - if (!first_time) { - first_time = true; + if (!firstTime) { + firstTime = true; if (!eglMakeCurrent(display, surface, surface, context)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent() returned error %d", eglGetError()); @@ -385,15 +385,15 @@ typedef enum { // Tuple is <buffer_format, depth_stencil_format, is_not_conformant, is_caveat, config_num, config_id> typedef std::tuple<BufferFormat, DepthStencilFormat, bool, bool, int, EGLConfig> ConfigProperties; -EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_configs) { - mbgl::Log::Info(mbgl::Event::OpenGL, "Found %d configs", num_configs); +EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint numConfigs) { + mbgl::Log::Info(mbgl::Event::OpenGL, "Found %d configs", numConfigs); // Create a list of configs that pass our filters - std::list<ConfigProperties> config_list; - for (int i = 0; i < num_configs; i++) { + std::list<ConfigProperties> configList; + for (int i = 0; i < numConfigs; i++) { mbgl::Log::Info(mbgl::Event::OpenGL, "Config %d:", i); - EGLint caveat, conformant, bits, red, green, blue, alpha, alpha_mask, depth, stencil, sample_buffers, samples; + EGLint caveat, conformant, bits, red, green, blue, alpha, alphaMask, depth, stencil, sampleBuffers, samples; if (!eglGetConfigAttrib(display, configs[i], EGL_CONFIG_CAVEAT, &caveat)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_CONFIG_CAVEAT) returned error %d", eglGetError()); @@ -430,7 +430,7 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf return nullptr; } - if (!eglGetConfigAttrib(display, configs[i], EGL_ALPHA_MASK_SIZE, &alpha_mask)) { + if (!eglGetConfigAttrib(display, configs[i], EGL_ALPHA_MASK_SIZE, &alphaMask)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_ALPHA_MASK_SIZE) returned error %d", eglGetError()); return nullptr; } @@ -445,7 +445,7 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf return nullptr; } - if (!eglGetConfigAttrib(display, configs[i], EGL_SAMPLE_BUFFERS, &sample_buffers)) { + if (!eglGetConfigAttrib(display, configs[i], EGL_SAMPLE_BUFFERS, &sampleBuffers)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_SAMPLE_BUFFERS) returned error %d", eglGetError()); return nullptr; } @@ -462,76 +462,76 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf mbgl::Log::Info(mbgl::Event::OpenGL, "...Green: %d", green); mbgl::Log::Info(mbgl::Event::OpenGL, "...Blue: %d", blue); mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha: %d", alpha); - mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha mask: %d", alpha_mask); + mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha mask: %d", alphaMask); mbgl::Log::Info(mbgl::Event::OpenGL, "...Depth: %d", depth); mbgl::Log::Info(mbgl::Event::OpenGL, "...Stencil: %d", stencil); - mbgl::Log::Info(mbgl::Event::OpenGL, "...Sample buffers: %d", sample_buffers); + mbgl::Log::Info(mbgl::Event::OpenGL, "...Sample buffers: %d", sampleBuffers); mbgl::Log::Info(mbgl::Event::OpenGL, "...Samples: %d", samples); - bool config_ok = true; - config_ok &= (depth == 24) || (depth == 16); - config_ok &= stencil == 8; - config_ok &= sample_buffers == 0; - config_ok &= samples == 0; + bool configOk = true; + configOk &= (depth == 24) || (depth == 16); + configOk &= stencil == 8; + configOk &= sampleBuffers == 0; + configOk &= samples == 0; // Filter our configs first for depth, stencil and anti-aliasing - if (config_ok) { + if (configOk) { // Work out the config's buffer format - BufferFormat buffer_format; + BufferFormat bufferFormat; if ((bits == 16) && (red == 5) && (green == 6) && (blue == 5) && (alpha == 0)) { - buffer_format = Format16Bit; + bufferFormat = Format16Bit; } else if ((bits == 32) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 0)) { - buffer_format = Format32BitNoAlpha; + bufferFormat = Format32BitNoAlpha; } else if ((bits == 32) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 8)) { - buffer_format = Format32BitAlpha; + bufferFormat = Format32BitAlpha; } else if ((bits == 24) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 0)) { - buffer_format = Format24Bit; + bufferFormat = Format24Bit; } else { - buffer_format = Unknown; + bufferFormat = Unknown; } // Work out the config's depth stencil format - DepthStencilFormat depth_stencil_format; + DepthStencilFormat depthStencilFormat; if ((depth == 16) && (stencil == 8)) { - depth_stencil_format = Format16Depth8Stencil; + depthStencilFormat = Format16Depth8Stencil; } else { - depth_stencil_format = Format24Depth8Stencil; + depthStencilFormat = Format24Depth8Stencil; } - bool is_not_conformant = (conformant & EGL_OPENGL_ES2_BIT) != EGL_OPENGL_ES2_BIT; - bool is_caveat = caveat != EGL_NONE; - EGLConfig config_id = configs[i]; + bool isNotConformant = (conformant & EGL_OPENGL_ES2_BIT) != EGL_OPENGL_ES2_BIT; + bool isCaveat = caveat != EGL_NONE; + EGLConfig configId = configs[i]; // Ignore formats we don't recognise - if (buffer_format != Unknown) + if (bufferFormat != Unknown) { - config_list.push_back(std::make_tuple(buffer_format, depth_stencil_format, is_not_conformant, is_caveat, i, config_id)); + configList.push_back(std::make_tuple(bufferFormat, depthStencilFormat, isNotConformant, isCaveat, i, configId)); } } } - if (config_list.empty()) { + if (configList.empty()) { mbgl::Log::Error(mbgl::Event::OpenGL, "Config list was empty."); } // Sort the configs to find the best one - config_list.sort(); - using_depth24 = std::get<1>(config_list.front()) == Format24Depth8Stencil; - bool is_conformant = !std::get<2>(config_list.front()); - bool is_caveat = std::get<3>(config_list.front()); - int config_num = std::get<4>(config_list.front()); - EGLConfig config_id = std::get<5>(config_list.front()); + configList.sort(); + usingDepth24 = std::get<1>(configList.front()) == Format24Depth8Stencil; + bool isConformant = !std::get<2>(configList.front()); + bool isCaveat = std::get<3>(configList.front()); + int configNum = std::get<4>(configList.front()); + EGLConfig configId = std::get<5>(configList.front()); - mbgl::Log::Info(mbgl::Event::OpenGL, "Chosen config is %d", config_num); + mbgl::Log::Info(mbgl::Event::OpenGL, "Chosen config is %d", configNum); - if (is_caveat) { + if (isCaveat) { mbgl::Log::Warning(mbgl::Event::OpenGL, "Chosen config has a caveat."); } - if (!is_conformant) { + if (!isConformant) { mbgl::Log::Warning(mbgl::Event::OpenGL, "Chosen config is not conformant."); } - return config_id; + return configId; } void NativeMapView::start() { @@ -578,13 +578,13 @@ void NativeMapView::loadExtensions() { if (extensions.find("GL_OES_packed_depth_stencil") != std::string::npos) { mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_packed_depth_stencil."); - gl::is_packed_depth_stencil_supported = true; + gl::isPackedDepthStencilSupported = true; } if (extensions.find("GL_OES_depth24") != std::string::npos) { mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_depth24."); - if (using_depth24) { - gl::is_depth24_supported = true; + if (usingDepth24) { + gl::isDepth24Supported = true; } else { mbgl::Log::Info(mbgl::Event::OpenGL, "Preferring 16 bit depth."); } @@ -600,11 +600,11 @@ void NativeMapView::stop() { } -void NativeMapView::pause(bool wait_for_pause) { - mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s", (wait_for_pause) ? "true" : "false"); +void NativeMapView::pause(bool waitForPause) { + mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s", (waitForPause) ? "true" : "false"); if ((display != EGL_NO_DISPLAY) && (context != EGL_NO_CONTEXT)) { - map.pause(wait_for_pause); + map.pause(waitForPause); } } @@ -651,7 +651,7 @@ void NativeMapView::notifyMapChange() { } } - env->CallVoidMethod(obj, on_map_changed_id); + env->CallVoidMethod(obj, onMapChangedId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); } @@ -668,28 +668,28 @@ void NativeMapView::notifyMapChange() { void NativeMapView::enableFps(bool enable) { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::enableFps()"); - fps_enabled = enable; + fpsEnabled = enable; } void NativeMapView::updateFps() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::updateFps()"); - if (!fps_enabled) { + if (!fpsEnabled) { return; } static int frames = 0; - static int64_t time_elapsed = 0LL; + static int64_t timeElapsed = 0LL; frames++; struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); - int64_t current_time = now.tv_sec*1000000000LL + now.tv_nsec; + int64_t currentTime = now.tv_sec*1000000000LL + now.tv_nsec; - if (current_time - time_elapsed >= 1) { - fps = frames / ((current_time - time_elapsed) / 1E9); + if (currentTime - timeElapsed >= 1) { + fps = frames / ((currentTime - timeElapsed) / 1E9); mbgl::Log::Debug(mbgl::Event::Render, "FPS: %4.2f", fps); - time_elapsed = current_time; + timeElapsed = currentTime; frames = 0; } @@ -704,8 +704,8 @@ void NativeMapView::updateFps() { jint ret; JNIEnv* env = nullptr; - bool detach = false; - ret = vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6); + bool detach = false; + ret = vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6); if (ret != JNI_OK) { if (ret != JNI_EDETACHED) { mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with %i", ret); @@ -720,7 +720,7 @@ void NativeMapView::updateFps() { } } - env->CallVoidMethod(obj, on_fps_changed_id, fps); + env->CallVoidMethod(obj, onFpsChangedId, fps); if (env->ExceptionCheck()) { env->ExceptionDescribe(); } diff --git a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java index 190dee4237..a10a825d5e 100644 --- a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java +++ b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java @@ -187,14 +187,14 @@ class NativeMapView { return nativeGetDefaultTransitionDuration(mNativeMapViewPtr); } - public void setDefaultTransitionDuration(long durationMilliseconds) { - if (durationMilliseconds < 0) { + public void setDefaultTransitionDuration(long milliseconds) { + if (milliseconds < 0) { throw new IllegalArgumentException( "durationMilliseconds cannot be negative."); } nativeSetDefaultTransitionDuration(mNativeMapViewPtr, - durationMilliseconds); + milliseconds); } public void setStyleUrl(String url) { @@ -456,7 +456,7 @@ class NativeMapView { private native List<String> nativeGetAppliedClasses(long nativeMapViewPtr); private native void nativeSetDefaultTransitionDuration( - long nativeMapViewPtr, long durationMilliseconds); + long nativeMapViewPtr, long milliseconds); private native long nativeGetDefaultTransitionDuration(long nativeMapViewPtr); diff --git a/include/mbgl/android/jni.hpp b/include/mbgl/android/jni.hpp index da3f59dae5..31772cf59c 100644 --- a/include/mbgl/android/jni.hpp +++ b/include/mbgl/android/jni.hpp @@ -7,32 +7,32 @@ namespace mbgl { namespace android { -extern std::string cache_path; -extern std::string data_path; -extern std::string apk_path; +extern std::string cachePath; +extern std::string dataPath; +extern std::string apkPath; -extern jmethodID on_map_changed_id; -extern jmethodID on_fps_changed_id; +extern jmethodID onMapChangedId; +extern jmethodID onFpsChangedId; -extern jclass lon_lat_class; -extern jmethodID lon_lat_constructor_id; -extern jfieldID lon_lat_lon_id; -extern jfieldID lon_lat_lat_id; +extern jclass lonLatClass; +extern jmethodID lonLatConstructorId; +extern jfieldID lonLatLonId; +extern jfieldID lonLatLatId; -extern jclass lon_lat_zoom_class; -extern jmethodID lon_lat_zoom_constructor_id; -extern jfieldID lon_lat_zoom_lon_id; -extern jfieldID lon_lat_zoom_lat_id; -extern jfieldID lon_lat_zoom_zoom_id; +extern jclass lonLatZoomClass; +extern jmethodID lonLatZoomConstructorId; +extern jfieldID lonLatZoomLonId; +extern jfieldID lonLatZoomLatId; +extern jfieldID lonLatZoomZoomId; -extern jclass runtime_exception_class; -extern jclass null_pointer_exception_class;; +extern jclass runtimeExceptionClass; +extern jclass nullPointerExceptionClass;; -extern jmethodID list_to_array_id; +extern jmethodID listToArrayId; -extern jclass array_list_class; -extern jmethodID array_list_constructor_id; -extern jmethodID array_list_add_id; +extern jclass arrayListClass; +extern jmethodID arrayListConstructorId; +extern jmethodID arrayListAddId; } } diff --git a/include/mbgl/android/native_map_view.hpp b/include/mbgl/android/native_map_view.hpp index 4752d18625..bfcd87675b 100644 --- a/include/mbgl/android/native_map_view.hpp +++ b/include/mbgl/android/native_map_view.hpp @@ -55,7 +55,7 @@ public: void stop(); void resume(); - void pause(bool wait_for_pause = false); + void pause(bool waitForPause = false); void notifyMapChange(); @@ -63,7 +63,7 @@ public: void updateFps(); private: - EGLConfig chooseConfig(const EGLConfig configs[], EGLint num_configs); + EGLConfig chooseConfig(const EGLConfig configs[], EGLint numConfigs); void loadExtensions(); @@ -83,14 +83,14 @@ private: EGLConfig config = nullptr; EGLint format = -1; - std::string style_url; - std::string api_key; + std::string styleUrl; + std::string apiKey; - bool first_time = false; + bool firstTime = false; - bool using_depth24 = false; + bool usingDepth24 = false; - bool fps_enabled = false; + bool fpsEnabled = false; double fps = 0.0; }; diff --git a/include/mbgl/platform/android/log_android.hpp b/include/mbgl/platform/android/log_android.hpp index 12ed3bd346..94d90a9b36 100644 --- a/include/mbgl/platform/android/log_android.hpp +++ b/include/mbgl/platform/android/log_android.hpp @@ -7,7 +7,7 @@ namespace mbgl { class AndroidLogBackend : public LogBackend { private: - int severity_to_priority(EventSeverity severity); + int severityToPriority(EventSeverity severity); public: inline ~AndroidLogBackend() = default; diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index 415c9740a9..f3b897e760 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -59,7 +59,7 @@ private: GLuint fbo = 0; GLuint fbo_depth_stencil = 0; GLuint fbo_color = 0; - bool using_gl_3_or_newer = false; + bool usingGl3OrNewer = false; }; } diff --git a/include/mbgl/platform/gl.hpp b/include/mbgl/platform/gl.hpp index e793cc7d03..ee781018ce 100644 --- a/include/mbgl/platform/gl.hpp +++ b/include/mbgl/platform/gl.hpp @@ -129,10 +129,10 @@ extern PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays; extern PFNGLGENVERTEXARRAYSPROC GenVertexArrays; extern PFNGLISVERTEXARRAYPROC IsVertexArray; -extern bool is_packed_depth_stencil_supported; +extern bool isPackedDepthStencilSupported; #define GL_DEPTH24_STENCIL8 0x88F0 -extern bool is_depth24_supported; +extern bool isDepth24Supported; #define GL_DEPTH_COMPONENT24 0x81A6 // Debug group markers, useful for debugging on iOS diff --git a/include/mbgl/renderer/prerendered_texture.hpp b/include/mbgl/renderer/prerendered_texture.hpp index 0563d90e96..3ccd24038d 100644 --- a/include/mbgl/renderer/prerendered_texture.hpp +++ b/include/mbgl/renderer/prerendered_texture.hpp @@ -26,11 +26,11 @@ public: const StyleBucketRaster &properties; private: - GLint previous_fbo = 0; + GLint previousFbo = 0; GLuint fbo = 0; GLuint texture = 0; - GLuint fbo_depth= 0; - GLuint fbo_stencil = 0; + GLuint fboDepth= 0; + GLuint fboStencil = 0; }; } diff --git a/platform/android/asset_request_baton_libzip.cpp b/platform/android/asset_request_baton_libzip.cpp index 628e9c93b6..7fc86ae1be 100644 --- a/platform/android/asset_request_baton_libzip.cpp +++ b/platform/android/asset_request_baton_libzip.cpp @@ -24,20 +24,20 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) { } int error = 0; - struct zip *apk = zip_open(mbgl::android::apk_path.c_str(), 0, &error); + struct zip *apk = zip_open(mbgl::android::apkPath.c_str(), 0, &error); if ((apk == nullptr) || ptr->canceled || !ptr->request) { // Opening the APK failed or was canceled. There isn't much left we can do. - const int message_size = zip_error_to_str(nullptr, 0, error, errno); - const std::unique_ptr<char[]> message = mbgl::util::make_unique<char[]>(message_size); + const int messageSize = zip_error_to_str(nullptr, 0, error, errno); + const std::unique_ptr<char[]> message = mbgl::util::make_unique<char[]>(messageSize); zip_error_to_str(message.get(), 0, error, errno); notify_error(ptr, 500, message.get()); cleanup(ptr); return; } - std::string apk_file_path = "assets/" + ptr->path; - struct zip_file *apk_file = zip_fopen(apk, apk_file_path.c_str(), ZIP_FL_NOCASE); - if ((apk_file == nullptr) || ptr->canceled || !ptr->request) { + std::string apkFilePath = "assets/" + ptr->path; + struct zip_file *apkFile = zip_fopen(apk, apkFilePath.c_str(), ZIP_FL_NOCASE); + if ((apkFile == nullptr) || ptr->canceled || !ptr->request) { // Opening the asset failed or was canceled. We already have an open file handle // though, which we'll have to close. zip_error_get(apk, &error, nullptr); @@ -49,12 +49,12 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) { } struct zip_stat stat; - if ((zip_stat(apk, apk_file_path.c_str(), ZIP_FL_NOCASE, &stat) != 0) || ptr->canceled || !ptr->request) { + if ((zip_stat(apk, apkFilePath.c_str(), ZIP_FL_NOCASE, &stat) != 0) || ptr->canceled || !ptr->request) { // Stating failed or was canceled. We already have an open file handle // though, which we'll have to close. notify_error(ptr, 500, zip_strerror(apk)); - zip_fclose(apk_file); - apk_file = nullptr; + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; cleanup(ptr); @@ -63,12 +63,12 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) { const std::unique_ptr<char[]> data = mbgl::util::make_unique<char[]>(stat.size); - if (static_cast<zip_uint64_t>(zip_fread(apk_file, reinterpret_cast<void *>(data.get()), stat.size)) != stat.size || ptr->canceled || !ptr->request) { + if (static_cast<zip_uint64_t>(zip_fread(apkFile, reinterpret_cast<void *>(data.get()), stat.size)) != stat.size || ptr->canceled || !ptr->request) { // Reading failed or was canceled. We already have an open file handle // though, which we'll have to close. - notify_error(ptr, 500, zip_file_strerror(apk_file)); - zip_fclose(apk_file); - apk_file = nullptr; + notify_error(ptr, 500, zip_file_strerror(apkFile)); + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; cleanup(ptr); @@ -83,10 +83,10 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) { ptr->request->notify(); } - if (zip_fclose(apk_file) != 0) { + if (zip_fclose(apkFile) != 0) { // Closing the asset failed. But there isn't anything we can do. } - apk_file = nullptr; + apkFile = nullptr; if (zip_close(apk) != 0) { // Closing the APK failed. But there isn't anything we can do. diff --git a/platform/android/cache_database_data.cpp b/platform/android/cache_database_data.cpp index aff1412687..2fefcdc4a3 100644 --- a/platform/android/cache_database_data.cpp +++ b/platform/android/cache_database_data.cpp @@ -6,7 +6,7 @@ namespace platform { // Returns the path to the default cache database on this system. std::string defaultCacheDatabase() { - return mbgl::android::cache_path + "/mbgl-cache.db"; + return mbgl::android::cachePath + "/mbgl-cache.db"; } } diff --git a/platform/android/log_android.cpp b/platform/android/log_android.cpp index 8a7e9df518..5e40ce33bd 100644 --- a/platform/android/log_android.cpp +++ b/platform/android/log_android.cpp @@ -9,7 +9,7 @@ namespace mbgl { -int AndroidLogBackend::severity_to_priority(EventSeverity severity) { +int AndroidLogBackend::severityToPriority(EventSeverity severity) { switch(severity) { case EventSeverity::Debug: return ANDROID_LOG_DEBUG; @@ -22,14 +22,14 @@ int AndroidLogBackend::severity_to_priority(EventSeverity severity) { case EventSeverity::Error: return ANDROID_LOG_ERROR; - + default: return ANDROID_LOG_VERBOSE; } } void AndroidLogBackend::record(EventSeverity severity, Event event, const std::string &msg) { - __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "%s", msg.c_str()); + __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "%s", msg.c_str()); } void AndroidLogBackend::record(EventSeverity severity, Event event, const char* format, ...) { @@ -42,18 +42,18 @@ void AndroidLogBackend::record(EventSeverity severity, Event event, const char* va_end(args); - __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "%s", buf); + __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "%s", buf); delete buf; buf = nullptr; } void AndroidLogBackend::record(EventSeverity severity, Event event, int64_t code) { - __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "(%" PRId64 ")", code); + __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "(%" PRId64 ")", code); } void AndroidLogBackend::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) { - __android_log_print(severity_to_priority(severity), EventClass(event).c_str(), "(%" PRId64 ") %s", code, msg.c_str()); + __android_log_print(severityToPriority(severity), EventClass(event).c_str(), "(%" PRId64 ") %s", code, msg.c_str()); } } diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 2f74b9c763..264fe4da6b 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -53,7 +53,7 @@ void HeadlessView::loadExtensions() { make_active(); std::string extensions; - if (using_gl_3_or_newer) { + if (usingGl3OrNewer) { #ifdef GL_VERSION_3_0 GLuint num_extensions = 0; glGetIntegerv(GL_NUM_EXTENSIONS, reinterpret_cast<GLint *>(&num_extensions)); @@ -108,7 +108,7 @@ static const core_profile_version core_profile_versions[] = { {0, 0}, }; -GLXContext createCoreProfile(Display *dpy, GLXFBConfig fbconfig, bool& using_gl_3_or_newer) { +GLXContext createCoreProfile(Display *dpy, GLXFBConfig fbconfig, bool& usingGl3OrNewer) { static bool context_creation_failed = false; GLXContext ctx = 0; @@ -136,7 +136,7 @@ GLXContext createCoreProfile(Display *dpy, GLXFBConfig fbconfig, bool& using_gl_ } if (core_profile_versions[i].major >= 3) { - using_gl_3_or_newer = true; + usingGl3OrNewer = true; } // Restore the old error handler. @@ -172,7 +172,7 @@ void HeadlessView::createContext() { #ifdef GLX_ARB_create_context if (glXCreateContextAttribsARB) { // Try to create a core profile context. - gl_context = createCoreProfile(x_display, fb_configs[0], using_gl_3_or_newer); + gl_context = createCoreProfile(x_display, fb_configs[0], usingGl3OrNewer); } #endif diff --git a/platform/default/http_request_baton_curl.cpp b/platform/default/http_request_baton_curl.cpp index 901ccbafd7..5578a69041 100644 --- a/platform/default/http_request_baton_curl.cpp +++ b/platform/default/http_request_baton_curl.cpp @@ -417,13 +417,13 @@ size_t curl_header_cb(char * const buffer, const size_t size, const size_t nmemb static CURLcode sslctx_function(CURL */*curl*/, void *sslctx, void */*parm*/) { int error = 0; - struct zip *apk = zip_open(mbgl::android::apk_path.c_str(), 0, &error); + struct zip *apk = zip_open(mbgl::android::apkPath.c_str(), 0, &error); if (apk == nullptr) { return CURLE_SSL_CACERT_BADFILE; } - struct zip_file *apk_file = zip_fopen(apk, "assets/ca-bundle.crt", ZIP_FL_NOCASE); - if (apk_file == nullptr) { + struct zip_file *apkFile = zip_fopen(apk, "assets/ca-bundle.crt", ZIP_FL_NOCASE); + if (apkFile == nullptr) { zip_close(apk); apk = nullptr; return CURLE_SSL_CACERT_BADFILE; @@ -431,16 +431,16 @@ static CURLcode sslctx_function(CURL */*curl*/, void *sslctx, void */*parm*/) { struct zip_stat stat; if (zip_stat(apk, "assets/ca-bundle.crt", ZIP_FL_NOCASE, &stat) != 0) { - zip_fclose(apk_file); - apk_file = nullptr; + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; return CURLE_SSL_CACERT_BADFILE; } if (stat.size > std::numeric_limits<int>::max()) { - zip_fclose(apk_file); - apk_file = nullptr; + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; return CURLE_SSL_CACERT_BADFILE; @@ -448,9 +448,9 @@ static CURLcode sslctx_function(CURL */*curl*/, void *sslctx, void */*parm*/) { const std::unique_ptr<char[]> pem = util::make_unique<char[]>(stat.size); - if (static_cast<zip_uint64_t>(zip_fread(apk_file, reinterpret_cast<void *>(pem.get()), stat.size)) != stat.size) { - zip_fclose(apk_file); - apk_file = nullptr; + if (static_cast<zip_uint64_t>(zip_fread(apkFile, reinterpret_cast<void *>(pem.get()), stat.size)) != stat.size) { + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; return CURLE_SSL_CACERT_BADFILE; @@ -498,8 +498,8 @@ static CURLcode sslctx_function(CURL */*curl*/, void *sslctx, void */*parm*/) { BIO_free(bio); bio = nullptr; - zip_fclose(apk_file); - apk_file = nullptr; + zip_fclose(apkFile); + apkFile = nullptr; zip_close(apk); apk = nullptr; diff --git a/src/platform/gl.cpp b/src/platform/gl.cpp index aa3a5f4f04..155fd70d95 100644 --- a/src/platform/gl.cpp +++ b/src/platform/gl.cpp @@ -71,10 +71,10 @@ PFNGLGENVERTEXARRAYSPROC GenVertexArrays = nullptr; PFNGLISVERTEXARRAYPROC IsVertexArray = nullptr; // GL_OES_packed_depth_stencil -bool is_packed_depth_stencil_supported = false; +bool isPackedDepthStencilSupported = false; // GL_OES_depth24 -bool is_depth24_supported = false; +bool isDepth24Supported = false; } } diff --git a/src/renderer/prerendered_texture.cpp b/src/renderer/prerendered_texture.cpp index 6c0b4a9fde..f17fe3b82a 100644 --- a/src/renderer/prerendered_texture.cpp +++ b/src/renderer/prerendered_texture.cpp @@ -17,14 +17,14 @@ PrerenderedTexture::~PrerenderedTexture() { texture = 0; } - if (fbo_depth != 0) { - glDeleteRenderbuffers(1, &fbo_depth); - fbo_depth = 0; + if (fboDepth != 0) { + glDeleteRenderbuffers(1, &fboDepth); + fboDepth = 0; } - if (fbo_stencil != 0) { - glDeleteRenderbuffers(1, &fbo_stencil); - fbo_stencil = 0; + if (fboStencil != 0) { + glDeleteRenderbuffers(1, &fboStencil); + fboStencil = 0; } if (fbo != 0) { @@ -44,7 +44,7 @@ void PrerenderedTexture::bindTexture() { } void PrerenderedTexture::bindFramebuffer() { - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &previous_fbo); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &previousFbo); if (texture == 0) { glGenTextures(1, &texture); @@ -60,14 +60,14 @@ void PrerenderedTexture::bindFramebuffer() { glBindTexture(GL_TEXTURE_2D, 0); } - if (fbo_depth == 0) { + if (fboDepth == 0) { // Create depth buffer - glGenRenderbuffers(1, &fbo_depth); - glBindRenderbuffer(GL_RENDERBUFFER, fbo_depth); - if (gl::is_packed_depth_stencil_supported) { + glGenRenderbuffers(1, &fboDepth); + glBindRenderbuffer(GL_RENDERBUFFER, fboDepth); + if (gl::isPackedDepthStencilSupported) { glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, properties.size, properties.size); } else { - if (gl::is_depth24_supported) { + if (gl::isDepth24Supported) { glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, properties.size, properties.size); } else { glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, properties.size, properties.size); @@ -77,10 +77,10 @@ void PrerenderedTexture::bindFramebuffer() { glBindRenderbuffer(GL_RENDERBUFFER, 0); } - if (!gl::is_packed_depth_stencil_supported && (fbo_stencil == 0)) { + if (!gl::isPackedDepthStencilSupported && (fboStencil == 0)) { // Create stencil buffer - glGenRenderbuffers(1, &fbo_stencil); - glBindRenderbuffer(GL_RENDERBUFFER, fbo_stencil); + glGenRenderbuffers(1, &fboStencil); + glBindRenderbuffer(GL_RENDERBUFFER, fboStencil); glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, properties.size, properties.size); glBindRenderbuffer(GL_RENDERBUFFER, 0); @@ -91,16 +91,16 @@ void PrerenderedTexture::bindFramebuffer() { glBindFramebuffer(GL_FRAMEBUFFER, fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); - if (gl::is_packed_depth_stencil_supported) { + if (gl::isPackedDepthStencilSupported) { #ifdef GL_ES_VERSION_2_0 - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo_depth); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo_depth); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fboDepth); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fboDepth); #else - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo_depth); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fboDepth); #endif } else { - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo_depth); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo_stencil); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fboDepth); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fboStencil); } GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -125,7 +125,7 @@ void PrerenderedTexture::bindFramebuffer() { } void PrerenderedTexture::unbindFramebuffer() { - glBindFramebuffer(GL_FRAMEBUFFER, previous_fbo); + glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); if (fbo != 0) { glDeleteFramebuffers(1, &fbo); @@ -134,12 +134,12 @@ void PrerenderedTexture::unbindFramebuffer() { } void PrerenderedTexture::blur(Painter& painter, uint16_t passes) { - const GLuint original_texture = texture; + const GLuint originalTexture = texture; // Create a secondary texture - GLuint secondary_texture; - glGenTextures(1, &secondary_texture); - glBindTexture(GL_TEXTURE_2D, secondary_texture); + GLuint secondaryTexture; + glGenTextures(1, &secondaryTexture); + glBindTexture(GL_TEXTURE_2D, secondaryTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -155,7 +155,7 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) { for (int i = 0; i < passes; i++) { // Render horizontal - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, secondary_texture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, secondaryTexture, 0); #if GL_EXT_discard_framebuffer && !__ANDROID__ const GLenum discards[] = { GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards); @@ -163,24 +163,24 @@ void PrerenderedTexture::blur(Painter& painter, uint16_t passes) { glClear(GL_COLOR_BUFFER_BIT); painter.gaussianShader->u_offset = {{ 1.0f / float(properties.size), 0 }}; - glBindTexture(GL_TEXTURE_2D, original_texture); + glBindTexture(GL_TEXTURE_2D, originalTexture); painter.coveringGaussianArray.bind(*painter.gaussianShader, painter.tileStencilBuffer, BUFFER_OFFSET(0)); glDrawArrays(GL_TRIANGLES, 0, (GLsizei)painter.tileStencilBuffer.index()); // Render vertical - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, original_texture, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, originalTexture, 0); #if GL_EXT_discard_framebuffer && !__ANDROID__ glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, discards); #endif glClear(GL_COLOR_BUFFER_BIT); painter.gaussianShader->u_offset = {{ 0, 1.0f / float(properties.size) }}; - glBindTexture(GL_TEXTURE_2D, secondary_texture); + glBindTexture(GL_TEXTURE_2D, secondaryTexture); painter.coveringGaussianArray.bind(*painter.gaussianShader, painter.tileStencilBuffer, BUFFER_OFFSET(0)); glDrawArrays(GL_TRIANGLES, 0, (GLsizei)painter.tileStencilBuffer.index()); } - glDeleteTextures(1, &secondary_texture); + glDeleteTextures(1, &secondaryTexture); } |