From fdab92988c0f2ba044dc500480679b1d2c6c7b49 Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 12 Mar 2012 19:29:26 +0300 Subject: [PATCH] [search] Do not show "Empty model message" when there are no features to draw, but country under screen center is loaded. --- map/framework.cpp | 5 ++++- map/render_queue_routine.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index e499436b80..47f1f388de 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -352,11 +352,14 @@ void Framework::DrawModel(shared_ptr const & e, bool Framework::IsEmptyModel(m2::PointD const & pt) { + /* string const fName = GetSearchEngine()->GetCountryFile(pt); if (fName.empty()) return false; return !m_model.IsLoaded(fName); + */ + return !m_model.IsCountryLoaded(pt); } void Framework::BeginPaint(shared_ptr const & e) @@ -762,8 +765,8 @@ void Framework::SetRenderPolicy(RenderPolicy * renderPolicy) if (m_renderPolicy.get()) { - m_renderPolicy->SetRenderFn(DrawModelFn()); m_renderPolicy->SetEmptyModelFn(bind(&Framework::IsEmptyModel, this, _1)); + m_renderPolicy->SetRenderFn(DrawModelFn()); m_navigator.SetSupportRotation(m_renderPolicy->DoSupportRotation()); diff --git a/map/render_queue_routine.cpp b/map/render_queue_routine.cpp index 703d254714..bc3da102e2 100644 --- a/map/render_queue_routine.cpp +++ b/map/render_queue_routine.cpp @@ -464,8 +464,11 @@ void RenderQueueRoutine::Do() break; /// if something were actually drawn, or (exclusive or) we are repainting the whole rect - if ((!cumulativeEmptyModelCurrent) || (fullRectRepaint)) - m_renderState->m_isEmptyModelActual = cumulativeEmptyModelCurrent; + if (!cumulativeEmptyModelCurrent || fullRectRepaint) + { + m_renderState->m_isEmptyModelActual = cumulativeEmptyModelCurrent && + m_emptyModelFn(m_currentRenderCommand->m_frameScreen.GlobalRect().GetGlobalRect().Center()); + } /// setting the "whole texture" clip rect to render texts opened by panning. m_threadDrawer->screen()->setClipRect(textureRect);