slowly it works..

master
steffen 13 years ago
parent 3bc2432a44
commit 98ad19dc03

@ -92,8 +92,8 @@ int map_area_add (struct map_area *area, int loadflags) {
int size; int size;
if (area->p == NULL || area->p_cnt == 0) return 0; if (area->p == NULL || area->p_cnt == 0) return 0;
area->type = area->subid % MAREA_campsite + 1; // area->type = area->subid % MAREA_campsite + 1;
d_printf ("subid:%d type:%d cnt:%d", area->subid, area->type, area->p_cnt); // d_printf ("subid:%d type:%d cnt:%d", area->subid, area->type, area->p_cnt);
size = map_area_getsize (area); size = map_area_getsize (area);
mh = map_hash_get (area->p[0].lon, area->p[0].lat, loadflags); mh = map_hash_get (area->p[0].lon, area->p[0].lat, loadflags);

@ -38,7 +38,7 @@
#include "memoryleak.h" #include "memoryleak.h"
#include "osmroute.h" #include "osmroute.h"
#define MAP_BITS_SUBID 5 #define MAP_BITS_SUBID 8
char *lsrw_data = NULL; char *lsrw_data = NULL;
int lsrw_data_size = 0; int lsrw_data_size = 0;

@ -1227,7 +1227,8 @@ int osm_area_split_add (struct s_osmmarea *marea) {
else if (i == 0) pt[i].angle = point_angle (pt[pt_c-1].km, pt[i].km, pt[i+1].km); else if (i == 0) pt[i].angle = point_angle (pt[pt_c-1].km, pt[i].km, pt[i+1].km);
else pt[i].angle = point_angle (pt[i-1].km, pt[i].km, pt[i+1].km); else pt[i].angle = point_angle (pt[i-1].km, pt[i].km, pt[i+1].km);
if (pt[i].angle > M_PI) { /* only select first pt */ if (pt[i].angle > M_PI) { /* only select first pt */
if (st == -1 ||st+1 == i) st = i; if (st == -1) st = i;
else if (pt[st].angle < pt[i].angle) st = i;
c++; c++;
} }
angle_sum += pt[i].angle; angle_sum += pt[i].angle;
@ -1340,7 +1341,7 @@ int osm_area_split_add (struct s_osmmarea *marea) {
sel++; if (sel >= pt_c) sel = 0; sel++; if (sel >= pt_c) sel = 0;
} }
} while (sel > st && a->p_cnt < 3); } while (sel != st && a->p_cnt < 3);
/* add element */ /* add element */
if (a->p_cnt >= 3) { if (a->p_cnt >= 3) {

Loading…
Cancel
Save