From 45cdf78471df4523e936c5d9341d8dc852e2c303 Mon Sep 17 00:00:00 2001 From: rachytski Date: Wed, 29 Dec 2010 02:08:21 +0200 Subject: [PATCH] [GCC] kD-tree compilation fixes. --- geometry/tree4d.hpp | 43 +++++++++++++++++++++-------------------- yg/geometry_batcher.hpp | 3 --- yg/text_renderer.cpp | 2 +- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/geometry/tree4d.hpp b/geometry/tree4d.hpp index c03dbb61ad..b8401ab9e4 100644 --- a/geometry/tree4d.hpp +++ b/geometry/tree4d.hpp @@ -41,6 +41,26 @@ namespace m4 typedef typename tree_t::_Region_ region_t; tree_t m_tree; + typedef vector store_vec_t; + + class insert_if_intersect + { + store_vec_t & m_isect; + m2::RectD const & m_rect; + + public: + insert_if_intersect(store_vec_t & isect, m2::RectD const & r) + : m_isect(isect), m_rect(r) + { + } + + void operator() (value_t const & v) + { + if (v.IsIntersect(m_rect)) + m_isect.push_back(&v); + } + }; + public: template @@ -61,34 +81,15 @@ namespace m4 } } - typedef vector store_vec_t; store_vec_t isect; - class insert_if_intersect - { - store_vec_t & m_isect; - m2::RectD const & m_rect; - - public: - insert_if_intersect(store_vec_t & isect, m2::RectD const & r) - : m_isect(isect), m_rect(r) - { - } - - void operator() (value_t const & v) - { - if (v.IsIntersect(m_rect)) - m_isect.push_back(&v); - } - }; - m_tree.visit_within_range(rgn, insert_if_intersect(isect, rect)); for (size_t i = 0; i < isect.size(); ++i) if (!comp(obj, isect[i]->m_val)) return; - for (store_vec_t::const_iterator i = isect.begin(); i != isect.end(); ++i) + for (typename store_vec_t::const_iterator i = isect.begin(); i != isect.end(); ++i) m_tree.erase(**i); m_tree.insert(value_t(obj, rect)); @@ -103,7 +104,7 @@ namespace m4 template void ForEach(ToDo toDo) const { - for (tree_t::const_iterator i = m_tree.begin(); i != m_tree.end(); ++i) + for (typename tree_t::const_iterator i = m_tree.begin(); i != m_tree.end(); ++i) toDo((*i).m_val); } diff --git a/yg/geometry_batcher.hpp b/yg/geometry_batcher.hpp index 4d10531418..badca84506 100644 --- a/yg/geometry_batcher.hpp +++ b/yg/geometry_batcher.hpp @@ -26,7 +26,6 @@ namespace yg { class Skin; struct CharStyle; - class ResourceManager; namespace gl { @@ -76,7 +75,6 @@ namespace yg /// Apply all states needed for rendering a batch of geometry. void applyStates(); - shared_ptr m_resourceManager; bool m_isAntiAliased; int m_aaShift; @@ -103,7 +101,6 @@ namespace yg void setSkin(shared_ptr skin); shared_ptr skin() const; - shared_ptr resManager() const { return m_resourceManager; } void beginFrame(); void endFrame(); diff --git a/yg/text_renderer.cpp b/yg/text_renderer.cpp index 1277c1eccd..5641b95990 100644 --- a/yg/text_renderer.cpp +++ b/yg/text_renderer.cpp @@ -20,7 +20,7 @@ void TextRenderer::TextObj::Draw(GeometryBatcher * pBatcher) const m2::RectD TextRenderer::TextObj::GetLimitRect(GeometryBatcher * pBatcher) const { - shared_ptr pRM = pBatcher->resManager(); + shared_ptr pRM = pBatcher->resourceManager(); m2::RectD rect; m2::PointD pt(0, 0);