From 2334f5a17e3c10ede617d072240c3eb3f2e1989f Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 28 May 2012 21:14:19 +0200 Subject: [PATCH] Fix point rendering --- OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java | 9 ++++++--- Osmand-kernel/osmand/src/rendering.cpp | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index 50c5b9c695..71437635f5 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -144,7 +144,7 @@ public class OsmandRenderer { return shaders.get(resId); } - private void put(TIntObjectHashMap map, int k, int v, int init){ + private void put(TIntObjectHashMap map, int k, int v){ if(!map.containsKey(k)){ map.put(k, new TIntArrayList()); } @@ -334,7 +334,6 @@ public class OsmandRenderer { private TIntObjectHashMap sortObjectsByProperOrder(RenderingContext rc, List objects, RenderingRuleSearchRequest render) { int sz = objects.size(); - int init = sz / 4; TIntObjectHashMap orderMap = new TIntObjectHashMap(); if (render != null) { render.clearState(); @@ -361,7 +360,11 @@ public class OsmandRenderer { if (render.search(RenderingRulesStorage.ORDER_RULES)) { int objectType = render.getIntPropertyValue(render.ALL.R_OBJECT_TYPE); int order = render.getIntPropertyValue(render.ALL.R_ORDER); - put(orderMap, (order << 2) | objectType, sh + j, init); + put(orderMap, (order << 2) | objectType, sh + j); + if(objectType == 3) { + // add icon point all the time + put(orderMap,(128 << 2)|1, sh + j); + } if (render.isSpecified(render.ALL.R_SHADOW_LEVEL)) { rc.shadowLevelMin = Math.min(rc.shadowLevelMin, order); rc.shadowLevelMax = Math.max(rc.shadowLevelMax, order); diff --git a/Osmand-kernel/osmand/src/rendering.cpp b/Osmand-kernel/osmand/src/rendering.cpp index 42ecf709b0..ea2a9cbb50 100644 --- a/Osmand-kernel/osmand/src/rendering.cpp +++ b/Osmand-kernel/osmand/src/rendering.cpp @@ -516,6 +516,11 @@ HMAP::hash_map > sortObjectsByProperOrder(std::vector getIntPropertyValue(req->props()->R_OBJECT_TYPE); int order = req->getIntPropertyValue(req->props()->R_ORDER); orderMap[(order << 2)|objectType].push_back(sh + j); + // polygon + if(objectType == 3) { + // add icon point all the time + orderMap[(128 << 2)|1].push_back(sh + j); + } if (req->getIntPropertyValue(req->props()->R_SHADOW_LEVEL) > 0) { rc->shadowLevelMin = std::min(rc->shadowLevelMin, order); rc->shadowLevelMax = std::max(rc->shadowLevelMax, order);