diff --git a/drape/batcher.hpp b/drape/batcher.hpp index 80ada3c26a..10ce4fd017 100644 --- a/drape/batcher.hpp +++ b/drape/batcher.hpp @@ -26,7 +26,7 @@ public: static uint32_t const IndexPerQuad = 6; static uint32_t const VertexPerQuad = 4; - Batcher(uint32_t indexBufferSize = 9000, uint32_t vertexBufferSize = 10000); + Batcher(uint32_t indexBufferSize = 65000, uint32_t vertexBufferSize = 65000); ~Batcher(); uint32_t GetIndexBufferSize() const { return m_indexBufferSize; } diff --git a/drape_frontend/backend_renderer.cpp b/drape_frontend/backend_renderer.cpp index 8e8b2c2814..132a4a3432 100644 --- a/drape_frontend/backend_renderer.cpp +++ b/drape_frontend/backend_renderer.cpp @@ -144,15 +144,24 @@ void BackendRenderer::AcceptMessage(ref_ptr message) { ref_ptr msg = message; gui::CountryStatusHelper & helper = gui::DrapeGui::Instance().GetCountryStatusHelper(); - if (msg->IsCurrentCountry()) + if (msg->IsCountryLoaded()) { - helper.SetCountryInfo(msg->GetCountryInfo()); + // country has already loaded, so we do not show country status gui + // even is the case then this country is updating + helper.Clear(); } else { - // check if country is current - if (helper.GetCountryIndex() == msg->GetCountryInfo().m_countryIndex) + if (msg->IsCurrentCountry()) + { helper.SetCountryInfo(msg->GetCountryInfo()); + } + else + { + // check if country is current + if (helper.GetCountryIndex() == msg->GetCountryInfo().m_countryIndex) + helper.SetCountryInfo(msg->GetCountryInfo()); + } } break; } diff --git a/drape_frontend/drape_engine.cpp b/drape_frontend/drape_engine.cpp index 3216bcd695..51ae3f8c8f 100644 --- a/drape_frontend/drape_engine.cpp +++ b/drape_frontend/drape_engine.cpp @@ -169,10 +169,10 @@ void DrapeEngine::ModelViewChangedGuiThread(ScreenBase const & screen) p.second(screen); } -void DrapeEngine::SetCountryInfo(gui::CountryInfo const & info, bool isCurrentCountry) +void DrapeEngine::SetCountryInfo(gui::CountryInfo const & info, bool isCurrentCountry, bool isCountryLoaded) { m_threadCommutator->PostMessage(ThreadsCommutator::ResourceUploadThread, - make_unique_dp(info, isCurrentCountry), + make_unique_dp(info, isCurrentCountry, isCountryLoaded), MessagePriority::Normal); } diff --git a/drape_frontend/drape_engine.hpp b/drape_frontend/drape_engine.hpp index 074788a020..252b0f3c7a 100644 --- a/drape_frontend/drape_engine.hpp +++ b/drape_frontend/drape_engine.hpp @@ -72,7 +72,7 @@ public: void SetRenderingEnabled(bool const isEnabled); - void SetCountryInfo(gui::CountryInfo const & info, bool isCurrentCountry); + void SetCountryInfo(gui::CountryInfo const & info, bool isCurrentCountry, bool isCountryLoaded); private: void AddUserEvent(UserEvent const & e); diff --git a/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp b/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp index c85420f403..c747ba46d5 100644 --- a/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp +++ b/drape_frontend/drape_frontend_tests/user_event_stream_tests.cpp @@ -7,6 +7,8 @@ #include "std/bind.hpp" #include "std/list.hpp" +#ifdef DEBUG + namespace { @@ -161,3 +163,5 @@ UNIT_TEST(SimpleScale) test.AddUserEvent(MakeTouchEvent(pointer1, pointer2, df::TouchEvent::TOUCH_UP)); test.RunTest(); } + +#endif diff --git a/drape_frontend/message_subclasses.hpp b/drape_frontend/message_subclasses.hpp index fb0a6583e7..16bf9402a3 100644 --- a/drape_frontend/message_subclasses.hpp +++ b/drape_frontend/message_subclasses.hpp @@ -250,18 +250,22 @@ private: class CountryInfoUpdateMessage : public Message { public: - CountryInfoUpdateMessage(gui::CountryInfo const & info, bool isCurrentCountry) + CountryInfoUpdateMessage(gui::CountryInfo const & info, bool isCurrentCountry, + bool isCountryLoaded) : m_countryInfo(info) , m_isCurrentCountry(isCurrentCountry) + , m_isCountryLoaded(isCountryLoaded) {} Type GetType() const override { return Message::CountryInfoUpdate;} gui::CountryInfo const & GetCountryInfo() const { return m_countryInfo; } bool IsCurrentCountry() const { return m_isCurrentCountry; } + bool IsCountryLoaded() const { return m_isCountryLoaded; } private: gui::CountryInfo m_countryInfo; bool m_isCurrentCountry; + bool m_isCountryLoaded; }; class MyPositionShapeMessage : public Message diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp index 3fe2417e5b..90f3572e6f 100644 --- a/map/active_maps_layout.cpp +++ b/map/active_maps_layout.cpp @@ -23,13 +23,17 @@ bool ActiveMapsLayout::Item::IsEqual(Item const & item) const ActiveMapsLayout::ActiveMapsLayout(Framework & framework) : m_framework(framework) { +#ifndef OMIM_OS_DESKTOP m_subscribeSlotID = GetStorage().Subscribe(bind(&ActiveMapsLayout::StatusChangedCallback, this, _1), bind(&ActiveMapsLayout::ProgressChangedCallback, this, _1, _2)); +#endif } ActiveMapsLayout::~ActiveMapsLayout() { +#ifndef OMIM_OS_DESKTOP GetStorage().Unsubscribe(m_subscribeSlotID); +#endif } void ActiveMapsLayout::Init(vector const & files) diff --git a/map/framework.cpp b/map/framework.cpp index 29f3cb668d..e55eb1525c 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -897,7 +897,9 @@ void Framework::UpdateCountryInfo(storage::TIndex const & countryIndex, bool isC countryInfo.m_downloadProgress = progress.first * 100 / progress.second; } - m_drapeEngine->SetCountryInfo(countryInfo, isCurrentCountry); + string const & fileName = m_storage.CountryByIndex(countryIndex).GetFile().GetFileWithoutExt(); + bool const isLoaded = m_model.IsLoaded(fileName); + m_drapeEngine->SetCountryInfo(countryInfo, isCurrentCountry, isLoaded); } void Framework::MemoryWarning()