slowly it works..

master
steffen 13 years ago
parent 98ad19dc03
commit 33eb721c22

@ -485,13 +485,13 @@ void draw_map () {
|| ((view_scale < 0.1 && (n % 2) == 0) || carea->p_cnt < 5) || ((view_scale < 0.1 && (n % 2) == 0) || carea->p_cnt < 5)
|| ((view_scale < 0.1 && (n % 4) == 0) || carea->p_cnt < 10)) { || ((view_scale < 0.1 && (n % 4) == 0) || carea->p_cnt < 10)) {
p1 = draw_geo2screen (view_lon, view_lat, carea->p[n].lon, carea->p[n].lat); p1 = draw_geo2screen (view_lon, view_lat, carea->p[n].lon, carea->p[n].lat);
if (n == 0) { // if (n == 0) {
draw_line (img_map, p1.x + center.x - 5, p1.y + center.y - 5, p1.x + center.x + 5, p1.y + center.y + 5, tmplinestyle); // draw_line (img_map, p1.x + center.x - 5, p1.y + center.y - 5, p1.x + center.x + 5, p1.y + center.y + 5, tmplinestyle);
draw_line (img_map, p1.x + center.x + 5, p1.y + center.y - 5, p1.x + center.x - 5, p1.y + center.y + 5, tmplinestyle); // draw_line (img_map, p1.x + center.x + 5, p1.y + center.y - 5, p1.x + center.x - 5, p1.y + center.y + 5, tmplinestyle);
} // }
if (n == 0) sprintf (text, "%d:%d", n, carea->subid); // if (n == 0) sprintf (text, "%d:%d", n, carea->subid);
else sprintf (text, "%d", n); // else sprintf (text, "%d", n);
gfx_draw_text (img_map, p1.x + center.x - 20, p1.y + center.y - 10, text, &color[COLOR_white][3]); // gfx_draw_text (img_map, p1.x + center.x - 20, p1.y + center.y - 10, text, &color[COLOR_white][3]);
draw_polygonadd (p1.x + center.x, p1.y + center.y); draw_polygonadd (p1.x + center.x, p1.y + center.y);
} }
draw_polygonfinish (img_map, tmplinestyle, &color_polygon[carea->type], 0); draw_polygonfinish (img_map, tmplinestyle, &color_polygon[carea->type], 0);

@ -1191,9 +1191,9 @@ int osm_area_split_add (struct s_osmmarea *marea) {
int _debug = 0; int _debug = 0;
float angle_sum; float angle_sum;
if (marea->marea->id == 22963833) _debug = 0; // if (marea->marea->id == 22963835) _debug = 1;
else return 1; // else return 1;
d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt); // d_printf ("marea: %lld cnt:%d", marea->marea->id, marea->marea->p_cnt);
// map_area_add (marea->marea, MHLOAD_RELOAD); // map_area_add (marea->marea, MHLOAD_RELOAD);
// return 1; // return 1;
@ -1245,6 +1245,7 @@ int osm_area_split_add (struct s_osmmarea *marea) {
for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i]; for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i];
ml_free (pt); ml_free (pt);
pt = pt_; pt = pt_;
continue;
} }
/* if c==0 save last areapart */ /* if c==0 save last areapart */
@ -1333,11 +1334,6 @@ int osm_area_split_add (struct s_osmmarea *marea) {
if (a->p_cnt < 3) { if (a->p_cnt < 3) {
/* found nothing try next one */ /* found nothing try next one */
// i = sel + 1; if (i >= pt_c) i = 0;
// do {
// sel = i;
// i++; if (i >= pt_c) i = 0;
// } while (sel > st && (pt[i].angle > M_PI || pt[sel].angle < M_PI));
sel++; if (sel >= pt_c) sel = 0; sel++; if (sel >= pt_c) sel = 0;
} }
@ -1363,11 +1359,10 @@ int osm_area_split_add (struct s_osmmarea *marea) {
d_printf ("%s:%d max subid reached. area id:%lld", __FILE__, __LINE__, a->id); d_printf ("%s:%d max subid reached. area id:%lld", __FILE__, __LINE__, a->id);
} }
if (pt[0].pnr >= 0 && pt_c > 0) { if (pt[0].pnr >= 0 && pt_c > 2) {
d_printf ("%s:%d osm_area_split_add: something went very wrong", __FILE__, __LINE__); d_printf ("%s:%d osm_area_split_add: something went very wrong", __FILE__, __LINE__);
d_printf (" marea->id: %lld:%d", a->id, a->subid); d_printf (" marea->id: %lld:%d", a->id, a->subid);
d_printf (" pt[0].pnr:%d pall_cnt: %d", pt[0].pnr, pt_c); d_printf (" pt[0].pnr:%d pt[1].pnr:%d pall_cnt: %d", pt[0].pnr, pt[1].pnr, pt_c);
} }
/* free unneeded memory and return to caller */ /* free unneeded memory and return to caller */

Loading…
Cancel
Save