From 69f4cf69c86d7709bc6688126f4d853ad554d3e7 Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 18 Nov 2014 10:47:39 +0300 Subject: [PATCH] [drape] remove useless. Add debug rendering. --- drape_frontend/engine_context.cpp | 42 +++++++++++++++++++++++++++++++ drape_frontend/engine_context.hpp | 2 -- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/drape_frontend/engine_context.cpp b/drape_frontend/engine_context.cpp index 304f833087..35d0c76bd7 100644 --- a/drape_frontend/engine_context.cpp +++ b/drape_frontend/engine_context.cpp @@ -1,7 +1,15 @@ #include "engine_context.hpp" +//#define DRAW_TILE_NET + #include "message_subclasses.hpp" #include "map_shape.hpp" +#ifdef DRAW_TILE_NET +#include "line_shape.hpp" +#include "text_shape.hpp" + +#include "../base/string_utils.hpp" +#endif namespace df { @@ -23,6 +31,40 @@ void EngineContext::InsertShape(TileKey const & key, dp::TransferPointer path; + path.push_back(r.LeftBottom()); + path.push_back(r.LeftTop()); + path.push_back(r.RightTop()); + path.push_back(r.RightBottom()); + path.push_back(r.LeftBottom()); + + m2::SharedSpline spline(path); + df::LineViewParams p; + p.m_baseGtoPScale = 1.0; + p.m_cap = dp::ButtCap; + p.m_color = dp::Color(255, 0, 0, 255); + p.m_depth = 20000; + p.m_width = 5; + p.m_join = dp::RoundJoin; + + InsertShape(key, dp::MovePointer(new LineShape(spline, p))); + + df::TextViewParams tp; + tp.m_anchor = dp::Center; + tp.m_depth = 20000; + tp.m_primaryText = strings::to_string(key.m_x) + " " + + strings::to_string(key.m_y) + " " + + strings::to_string(key.m_zoomLevel); + + tp.m_primaryTextFont = df::FontDecl{ dp::Color(255, 0, 0, 255), + dp::Color(0, 0, 0, 0), + 30, true}; + + InsertShape(key, dp::MovePointer(new TextShape(r.Center(), tp))); +#endif + PostMessage(new TileReadEndMessage(key)); } diff --git a/drape_frontend/engine_context.hpp b/drape_frontend/engine_context.hpp index 0bcf28a0d0..875717d7f9 100644 --- a/drape_frontend/engine_context.hpp +++ b/drape_frontend/engine_context.hpp @@ -4,8 +4,6 @@ #include "../drape/pointers.hpp" -#include "../map/scales_processor.hpp" - namespace df {