From daa3deb3270473643da57aec9127fdd505dfc5b5 Mon Sep 17 00:00:00 2001 From: ExMix Date: Thu, 7 Aug 2014 10:05:56 +0300 Subject: [PATCH] [drape] magic numbers fix --- drape_frontend/path_symbol_shape.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drape_frontend/path_symbol_shape.cpp b/drape_frontend/path_symbol_shape.cpp index 1ff388579e..4ba14bea85 100644 --- a/drape_frontend/path_symbol_shape.cpp +++ b/drape_frontend/path_symbol_shape.cpp @@ -16,6 +16,8 @@ using m2::Spline; using glsl_types::vec2; using glsl_types::vec4; +int const VertexPerQuad = 4; + class PathSymbolHandle : public dp::OverlayHandle { public: @@ -23,7 +25,7 @@ public: PathSymbolHandle(m2::SharedSpline const & spl, PathSymbolViewParams const & params, int maxCount, float hw, float hh) : OverlayHandle(FeatureID(), dp::Center, 0.0f), m_params(params), m_spline(spl), m_scaleFactor(1.0f), - m_positions(maxCount * 6), m_maxCount(maxCount), + m_positions(maxCount * VertexPerQuad), m_maxCount(maxCount), m_symbolHalfWidth(hw), m_symbolHalfHeight(hh) { SetIsVisible(true); @@ -36,9 +38,7 @@ public: Spline::iterator itr = m_spline.CreateIterator(); itr.Step((m_params.m_offset + m_symbolHalfWidth) * m_scaleFactor); - for (int i = 0; i < m_maxCount * 6; ++i) - m_positions[i] = vec2(0.0f, 0.0f); - + fill(m_positions.begin(), m_positions.end(), vec2(0.0f, 0.0f)); vec2 * it = &m_positions[0]; for (int i = 0; i < m_maxCount; ++i) @@ -97,7 +97,7 @@ void PathSymbolShape::Draw(dp::RefPointer batcher, dp::RefPointer positions(vertCnt, vec2(0.0f, 0.0f)); vector uvs(vertCnt); vec4 * tc = &uvs[0]; @@ -158,7 +158,7 @@ void PathSymbolShape::Draw(dp::RefPointer batcher, dp::RefPointerInsertListOfStrip(state, dp::MakeStackRefPointer(&provider), dp::MovePointer(handle), 4); + batcher->InsertListOfStrip(state, dp::MakeStackRefPointer(&provider), dp::MovePointer(handle), VertexPerQuad); } }