/[zanavi_public1]/navit/navit/graphics.c
ZANavi

Diff of /navit/navit/graphics.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 53 Revision 54
1258 gra->meth.draw_lines(gra->priv, gc->priv, pnt, 3); 1258 gra->meth.draw_lines(gra->priv, gc->priv, pnt, 3);
1259} 1259}
1260 1260
1261static void display_draw_arrows(struct graphics *gra, struct graphics_gc *gc, struct point *pnt, int count) 1261static void display_draw_arrows(struct graphics *gra, struct graphics_gc *gc, struct point *pnt, int count)
1262{ 1262{
1263
1263 int i, dx, dy, l; 1264 int i, dx, dy, l;
1264 struct point p; 1265 struct point p;
1265 for (i = 0; i < count - 1; i++) 1266 for (i = 0; i < count - 1; i++)
1266 { 1267 {
1267 dx = pnt[i + 1].x - pnt[i].x; 1268 dx = pnt[i + 1].x - pnt[i].x;
2525 count = transform(dc->trans, dc->pro, di->c, pa, count, mindist, 0, NULL); 2526 count = transform(dc->trans, dc->pro, di->c, pa, count, mindist, 0, NULL);
2526 } 2527 }
2527 2528
2528 //dbg(0,"**dc->type=%s count=%d\n", item_to_name(dc->type), count); 2529 //dbg(0,"**dc->type=%s count=%d\n", item_to_name(dc->type), count);
2529 //dbg(0,"** e->type=%s\n", item_to_name(e->type)); 2530 //dbg(0,"** e->type=%s\n", item_to_name(e->type));
2531
2532
2533 // system_log(0,"**dc->type=%s count=%d\n", item_to_name(dc->type), count);
2534 // system_log(0,"** e->type=%s int=%d\n", item_to_name(e->type), e->type);
2530 2535
2531 switch (e->type) 2536 switch (e->type)
2532 { 2537 {
2533 case element_polygon: 2538 case element_polygon:
2534 graphics_draw_polygon_clipped(gra, gc, pa, count); 2539 graphics_draw_polygon_clipped(gra, gc, pa, count);
2943 //} 2948 //}
2944 break; 2949 break;
2945 case element_arrows: 2950 case element_arrows:
2946 display_draw_arrows(gra, gc, pa, count); 2951 display_draw_arrows(gra, gc, pa, count);
2947 break; 2952 break;
2948 //default: 2953 //default:
2954 // dbg(0, "Unhandled element type %d\n", e->type);
2949 // printf("Unhandled element type %d\n", e->type); 2955 // printf("Unhandled element type %d\n", e->type);
2956 // system_log(0, "Unhandled element type %d\n", e->type);
2950 } 2957 }
2951 di = di->next; 2958 di = di->next;
2952 } 2959 }
2953 2960
2954 //if (run_type > 100) // dbg(0,"gg099\n"); 2961 //if (run_type > 100) // dbg(0,"gg099\n");
2997 break; 3004 break;
2998 } 3005 }
2999 3006
3000 dc->type = GPOINTER_TO_INT(types->data); 3007 dc->type = GPOINTER_TO_INT(types->data);
3001 // dbg(0,"**type=%s\n", item_to_name(dc->type)); 3008 // dbg(0,"**type=%s\n", item_to_name(dc->type));
3009 // system_log(0,"**type=%s\n", item_to_name(dc->type));
3002 3010
3003 if (global_draw_multipolygons == 0) 3011 if (global_draw_multipolygons == 0)
3004 { 3012 {
3005 if (dc->type == type_poly_water_from_relations) 3013 if (dc->type == type_poly_water_from_relations)
3006 { 3014 {
3029 { 3037 {
3030 entry = get_hash_entry(display_list, dc->type); 3038 entry = get_hash_entry(display_list, dc->type);
3031 if (entry && entry->di) 3039 if (entry && entry->di)
3032 { 3040 {
3033 //dbg(0,"++type=%s\n", item_to_name(dc->type)); 3041 //dbg(0,"++type=%s\n", item_to_name(dc->type));
3042
3043 // system_log(0,"++type=%s\n", item_to_name(dc->type));
3044
3034 //dbg(0, "is_first_item=%d run_type=%d\n", is_first_item, run_type); 3045 //dbg(0, "is_first_item=%d run_type=%d\n", is_first_item, run_type);
3035 //if (!strcmp(item_to_name(dc->type), "border_country")) 3046 //if (!strcmp(item_to_name(dc->type), "border_country"))
3036 //{ 3047 //{
3037 // displayitem_draw(entry->di, NULL, dc, display_list->order, 1, 101); 3048 // displayitem_draw(entry->di, NULL, dc, display_list->order, 1, 101);
3038 //} 3049 //}
3154 fast_draw_mode = 1; 3165 fast_draw_mode = 1;
3155 run_type = 99; // draw only 1 pass, bridges and tunnels will be drawn in any order 3166 run_type = 99; // draw only 1 pass, bridges and tunnels will be drawn in any order
3156 } 3167 }
3157 3168
3158 // dbg(0,"layer name=%s\n", lay->name); 3169 // dbg(0,"layer name=%s\n", lay->name);
3170 // system_log(0,"layer name=%s\n", lay->name);
3159 3171
3160 // reset max drawing counters ---------------------- 3172 // reset max drawing counters ----------------------
3161 poi_on_map_count = 0; 3173 poi_on_map_count = 0;
3162 label_on_map_count = 0; 3174 label_on_map_count = 0;
3163 label_district_on_map_count = 0; 3175 label_district_on_map_count = 0;
4614 // dbg(0,"draw_vector_map=%d mapset_need_draw=%d\n", draw_vector_map, mapset_need_draw); 4626 // dbg(0,"draw_vector_map=%d mapset_need_draw=%d\n", draw_vector_map, mapset_need_draw);
4615 // ****** if ((draw_vector_map) || (mapset_need_draw == 1)) 4627 // ****** if ((draw_vector_map) || (mapset_need_draw == 1))
4616 if (mapset_need_draw == 1) 4628 if (mapset_need_draw == 1)
4617 { 4629 {
4618 //dbg(0,"MAP:002:map=%s\n", ttt22); 4630 //dbg(0,"MAP:002:map=%s\n", ttt22);
4631 //if (ttt22)
4632 //{
4633 // system_log(0, "MAP:map=%s\n", ttt22);
4634 //}
4635 //else
4636 //{
4637 // system_log(0, "MAP:map=NULL\n");
4638 //}
4619 4639
4620 //// dbg(0, "XXXXXYYYYYYY Draw: A.01\n"); 4640 //// dbg(0, "XXXXXYYYYYYY Draw: A.01\n");
4621 4641
4622 4642
4623 // ------ READ all items in this map rectangle --------- 4643 // ------ READ all items in this map rectangle ---------
4686 // DEBUG -------- zoffzoff 4706 // DEBUG -------- zoffzoff
4687 //item_dump_attr_stdout(item, displaylist->m); 4707 //item_dump_attr_stdout(item, displaylist->m);
4688 // DEBUG -------- zoffzoff 4708 // DEBUG -------- zoffzoff
4689 // DEBUG -------- zoffzoff 4709 // DEBUG -------- zoffzoff
4690 // DEBUG -------- zoffzoff 4710 // DEBUG -------- zoffzoff
4711
4712 //if (item->type == type_rg_segment)
4713 //{
4714 // system_log(0, "type_rg_segment:001");
4715 //}
4691 4716
4692 if (!entry) 4717 if (!entry)
4693 { 4718 {
4694 continue; 4719 continue;
4695 } 4720 }
4916 } 4941 }
4917 if (label_count > 1) 4942 if (label_count > 1)
4918 { 4943 {
4919 labels[1] = map_convert_string(displaylist->m, labels[1]); 4944 labels[1] = map_convert_string(displaylist->m, labels[1]);
4920 } 4945 }
4946
4921 display_add(entry, item, count, ca, labels, label_count, 1, col_int_value); 4947 display_add(entry, item, count, ca, labels, label_count, 1, col_int_value);
4948
4922 if (label_count > 0) 4949 if (label_count > 0)
4923 { 4950 {
4924 map_convert_free(labels[0]); 4951 map_convert_free(labels[0]);
4925 } 4952 }
4926 if (label_count > 1) 4953 if (label_count > 1)
5639 di.item.type=(enum item_type)item->priv_data; 5666 di.item.type=(enum item_type)item->priv_data;
5640 display_add(dl, &di.item, di_res->count, di_res->c, NULL, 0); 5667 display_add(dl, &di.item, di_res->count, di_res->c, NULL, 0);
5641 return; 5668 return;
5642 } 5669 }
5643 } 5670 }
5671
5644 mr=map_rect_new(item->map, NULL); 5672 mr=map_rect_new(item->map, NULL);
5645 item=map_rect_get_item_byid(mr, item->id_hi, item->id_lo); 5673 item=map_rect_get_item_byid(mr, item->id_hi, item->id_lo);
5646 count=item_coord_get(item, ca, item->type < type_line ? 1: max); 5674 count=item_coord_get(item, ca, item->type < type_line ? 1: max);
5675
5647 if (!item_attr_get(item, attr_label, &attr)) 5676 if (!item_attr_get(item, attr_label, &attr))
5677 {
5648 attr.u.str=NULL; 5678 attr.u.str=NULL;
5679 }
5680
5649 if (dl->conv && attr.u.str && attr.u.str[0]) 5681 if (dl->conv && attr.u.str && attr.u.str[0])
5650 { 5682 {
5651 char *str=map_convert_string(item->map, attr.u.str); 5683 char *str=map_convert_string(item->map, attr.u.str);
5652 display_add(dl, item, count, ca, &str, 1); 5684 display_add(dl, item, count, ca, &str, 1);
5653 map_convert_free(str); 5685 map_convert_free(str);

Legend:
Removed from v.53  
changed lines
  Added in v.54

   
Visit the ZANavi Wiki