diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 91462544cb..d6afd8a2b2 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -171,7 +171,7 @@ bool Framework::DestroySurfaceOnDetach() } bool Framework::CreateDrapeEngine(JNIEnv * env, jobject jSurface, int densityDpi, bool firstLaunch, - bool launchByDeepLink, int appVersionCode) + bool launchByDeepLink, uint32_t appVersionCode) { // Vulkan is supported only since Android 8.0, because some Android devices with Android 7.x // have fatal driver issue, which can lead to process termination and whole OS destabilization. diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index ececcbdf94..be4f72c742 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -92,7 +92,7 @@ namespace android void OnCompassUpdated(location::CompassInfo const & info, bool forceRedraw); bool CreateDrapeEngine(JNIEnv * env, jobject jSurface, int densityDpi, bool firstLaunch, - bool launchByDeepLink, int appVersionCode); + bool launchByDeepLink, uint32_t appVersionCode); bool IsDrapeEngineCreated(); bool DestroySurfaceOnDetach(); void DetachSurface(bool destroySurface); diff --git a/android/jni/com/mapswithme/maps/MapFragment.cpp b/android/jni/com/mapswithme/maps/MapFragment.cpp index 990dc325a3..885621e72c 100644 --- a/android/jni/com/mapswithme/maps/MapFragment.cpp +++ b/android/jni/com/mapswithme/maps/MapFragment.cpp @@ -73,7 +73,7 @@ Java_com_mapswithme_maps_MapFragment_nativeCreateEngine(JNIEnv * env, jclass cla jint appVersionCode) { return g_framework->CreateDrapeEngine(env, surface, density, firstLaunch, isLaunchByDeepLink, - appVersionCode); + base::asserted_cast(appVersionCode)); } JNIEXPORT jboolean JNICALL diff --git a/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.cpp b/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.cpp index 21a2d1201e..0f058c93a9 100644 --- a/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.cpp +++ b/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.cpp @@ -25,7 +25,7 @@ public: DrawVulkanContext(VkInstance vulkanInstance, VkPhysicalDevice gpu, VkPhysicalDeviceProperties const & gpuProperties, VkDevice device, uint32_t renderingQueueFamilyIndex, - ref_ptr objectManager, int appVersionCode, + ref_ptr objectManager, uint32_t appVersionCode, bool hasPartialTextureUpdates) : dp::vulkan::VulkanBaseContext( vulkanInstance, gpu, gpuProperties, device, renderingQueueFamilyIndex, objectManager, @@ -86,7 +86,7 @@ public: }; } // namespace -AndroidVulkanContextFactory::AndroidVulkanContextFactory(int appVersionCode, int sdkVersion) +AndroidVulkanContextFactory::AndroidVulkanContextFactory(uint32_t appVersionCode, int sdkVersion) { if (InitVulkan() == 0) { @@ -98,8 +98,8 @@ AndroidVulkanContextFactory::AndroidVulkanContextFactory(int appVersionCode, int appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; appInfo.pNext = nullptr; appInfo.apiVersion = VK_MAKE_VERSION(1, 0, 0); - appInfo.applicationVersion = static_cast(appVersionCode); - appInfo.engineVersion = static_cast(appVersionCode); + appInfo.applicationVersion = appVersionCode; + appInfo.engineVersion = appVersionCode; appInfo.pApplicationName = "OMaps"; appInfo.pEngineName = "Drape Engine"; diff --git a/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.hpp b/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.hpp index beb7764ab0..e57bb2916e 100644 --- a/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.hpp +++ b/android/jni/com/mapswithme/vulkan/android_vulkan_context_factory.hpp @@ -18,7 +18,7 @@ namespace android class AndroidVulkanContextFactory : public dp::GraphicsContextFactory { public: - explicit AndroidVulkanContextFactory(int appVersionCode, int sdkVersion); + explicit AndroidVulkanContextFactory(uint32_t appVersionCode, int sdkVersion); ~AndroidVulkanContextFactory(); bool IsVulkanSupported() const; diff --git a/drape/vulkan/vulkan_pipeline.cpp b/drape/vulkan/vulkan_pipeline.cpp index 989718a02e..85300bf506 100644 --- a/drape/vulkan/vulkan_pipeline.cpp +++ b/drape/vulkan/vulkan_pipeline.cpp @@ -150,7 +150,7 @@ std::string GetDumpFilePath() } } // namespace -VulkanPipeline::VulkanPipeline(VkDevice device, int appVersionCode) +VulkanPipeline::VulkanPipeline(VkDevice device, uint32_t appVersionCode) : m_appVersionCode(appVersionCode) { // Read dump. @@ -163,7 +163,7 @@ VulkanPipeline::VulkanPipeline(VkDevice device, int appVersionCode) FileReader r(dumpFilePath); NonOwningReaderSource src(r); - auto const v = ReadPrimitiveFromSource(src); + auto const v = ReadPrimitiveFromSource(src); if (v != appVersionCode) { // Dump is obsolete. @@ -171,7 +171,7 @@ VulkanPipeline::VulkanPipeline(VkDevice device, int appVersionCode) } else { - dumpData.resize(static_cast(r.Size() - sizeof(int))); + dumpData.resize(static_cast(r.Size() - sizeof(uint32_t))); src.Read(dumpData.data(), dumpData.size()); } } diff --git a/drape/vulkan/vulkan_pipeline.hpp b/drape/vulkan/vulkan_pipeline.hpp index 435c0913df..d9e8c5fe9c 100644 --- a/drape/vulkan/vulkan_pipeline.hpp +++ b/drape/vulkan/vulkan_pipeline.hpp @@ -46,7 +46,7 @@ public: bool m_blendingEnabled = false; }; - VulkanPipeline(VkDevice device, int appVersionCode); + VulkanPipeline(VkDevice device, uint32_t appVersionCode); void Dump(VkDevice device); void Destroy(VkDevice device); void ResetCache(VkDevice device); @@ -55,7 +55,7 @@ public: VkPipeline GetPipeline(VkDevice device, PipelineKey const & key); private: - int const m_appVersionCode; + uint32_t const m_appVersionCode; VkPipelineCache m_vulkanPipelineCache; using PipelineCache = std::map;