Fix point rendering

This commit is contained in:
Victor Shcherb 2012-05-28 21:14:19 +02:00
parent 587d881a55
commit 2334f5a17e
2 changed files with 11 additions and 3 deletions

View file

@ -144,7 +144,7 @@ public class OsmandRenderer {
return shaders.get(resId); return shaders.get(resId);
} }
private void put(TIntObjectHashMap<TIntArrayList> map, int k, int v, int init){ private void put(TIntObjectHashMap<TIntArrayList> map, int k, int v){
if(!map.containsKey(k)){ if(!map.containsKey(k)){
map.put(k, new TIntArrayList()); map.put(k, new TIntArrayList());
} }
@ -334,7 +334,6 @@ public class OsmandRenderer {
private TIntObjectHashMap<TIntArrayList> sortObjectsByProperOrder(RenderingContext rc, List<BinaryMapDataObject> objects, private TIntObjectHashMap<TIntArrayList> sortObjectsByProperOrder(RenderingContext rc, List<BinaryMapDataObject> objects,
RenderingRuleSearchRequest render) { RenderingRuleSearchRequest render) {
int sz = objects.size(); int sz = objects.size();
int init = sz / 4;
TIntObjectHashMap<TIntArrayList> orderMap = new TIntObjectHashMap<TIntArrayList>(); TIntObjectHashMap<TIntArrayList> orderMap = new TIntObjectHashMap<TIntArrayList>();
if (render != null) { if (render != null) {
render.clearState(); render.clearState();
@ -361,7 +360,11 @@ public class OsmandRenderer {
if (render.search(RenderingRulesStorage.ORDER_RULES)) { if (render.search(RenderingRulesStorage.ORDER_RULES)) {
int objectType = render.getIntPropertyValue(render.ALL.R_OBJECT_TYPE); int objectType = render.getIntPropertyValue(render.ALL.R_OBJECT_TYPE);
int order = render.getIntPropertyValue(render.ALL.R_ORDER); 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)) { if (render.isSpecified(render.ALL.R_SHADOW_LEVEL)) {
rc.shadowLevelMin = Math.min(rc.shadowLevelMin, order); rc.shadowLevelMin = Math.min(rc.shadowLevelMin, order);
rc.shadowLevelMax = Math.max(rc.shadowLevelMax, order); rc.shadowLevelMax = Math.max(rc.shadowLevelMax, order);

View file

@ -516,6 +516,11 @@ HMAP::hash_map<int, std::vector<int> > sortObjectsByProperOrder(std::vector <Map
int objectType = req->getIntPropertyValue(req->props()->R_OBJECT_TYPE); int objectType = req->getIntPropertyValue(req->props()->R_OBJECT_TYPE);
int order = req->getIntPropertyValue(req->props()->R_ORDER); int order = req->getIntPropertyValue(req->props()->R_ORDER);
orderMap[(order << 2)|objectType].push_back(sh + j); 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) { if (req->getIntPropertyValue(req->props()->R_SHADOW_LEVEL) > 0) {
rc->shadowLevelMin = std::min(rc->shadowLevelMin, order); rc->shadowLevelMin = std::min(rc->shadowLevelMin, order);
rc->shadowLevelMax = std::max(rc->shadowLevelMax, order); rc->shadowLevelMax = std::max(rc->shadowLevelMax, order);