rotate only once..

master
steffen 13 years ago
parent 33eb721c22
commit 98347c53eb

@ -1188,7 +1188,7 @@ int osm_area_split_add (struct s_osmmarea *marea) {
struct map_area *a = NULL;
struct s_osmareapnt *pt = ml_malloc (sizeof (struct s_osmareapnt) * marea->marea->p_cnt);
int i, st, pt_c, c;
int _debug = 0;
int _debug = 0, rotated = 0;
float angle_sum;
// if (marea->marea->id == 22963835) _debug = 1;
@ -1238,13 +1238,14 @@ int osm_area_split_add (struct s_osmmarea *marea) {
if (_debug) d_printf ("c:%d pt_c:%d st:%d angle_sum:%f",c, pt_c, st, angle_sum);
/* make sure we going counterclock direction, only first area */
if (angle_sum > M_PI && a->subid == marea->marea->subid) {
if (rotated == 0 && angle_sum > M_PI && a->subid == marea->marea->subid) {
struct s_osmareapnt *pt_ = ml_malloc (sizeof (struct s_osmareapnt) * pt_c);
if (_debug) d_printf ("change rotation ...");
for (i = 0; i < pt_c; i++) pt_[pt_c - i - 1] = pt[i];
ml_free (pt);
pt = pt_;
rotated = 1;
continue;
}
@ -1350,6 +1351,7 @@ int osm_area_split_add (struct s_osmmarea *marea) {
for (c = 0, i = 0; i < pt_c; i++) if (pt[i].pnr != -1) pt[c++] = pt[i];
if (pt_c == c) {
d_printf ("%s:%d pt_c == c : nothing deleted.. something went wrong.", __FILE__, __LINE__);
d_printf (" rotated:%d", rotated);
break;
}
pt_c = c;

Loading…
Cancel
Save