char *name1;
char *name2;
struct item item;
+ int direction;
int angle_start;
int angle_end;
struct coord c;
struct navigation_itm *ret=g_new0(struct navigation_itm, 1);
int l,i=0;
struct item *sitem;
- struct attr street_item;
+ struct attr street_item,direction;
struct map_rect *mr;
struct attr attr;
struct coord c[5];
dbg(0,"no street item\n");
return NULL;
}
+ if (item_attr_get(ritem, attr_direction, &direction))
+ ret->direction=direction.u.num;
+ else
+ ret->direction=0;
sitem=street_item.u.item;
ret->item=*sitem;
item_hash_insert(this_->hash, sitem, ret);
struct map *map;
struct map_rect *mr;
struct item *ritem,*sitem;
- struct attr street_item;
+ struct attr street_item,street_direction;
struct navigation_itm *itm;
int incr=0;
dbg(0,"no street item\n");
}
}
+ if (!item_attr_get(ritem, attr_direction, &street_direction))
+ street_direction.u.num=0;
sitem=street_item.u.item;
dbg(1,"sitem=%p\n", sitem);
itm=item_hash_lookup(this_->hash, sitem);
dbg(2,"itm for item with id (0x%x,0x%x) is %p\n", sitem->id_hi, sitem->id_lo, itm);
+ if (itm && itm->direction != street_direction.u.num) {
+ dbg(2,"wrong direction\n");
+ itm=NULL;
+ }
navigation_destroy_itms_cmds(this_, itm);
if (itm) {
incr=1;
struct item item;
int length;
int offset;
+ int direction;
unsigned ncoords;
struct coord c[0];
};
segment=g_malloc0(sizeof(*segment) + sizeof(struct coord) * ccount);
segment->ncoords=ccount;
+ segment->direction=dir;
if (first)
segment->c[idx++]=*first;
if (dir > 0) {
printf("%s:Out of memory\n", __FUNCTION__);
return;
}
+ segment->direction=dir;
if (dir > 0) {
for (i = 0 ; i < ccnt ; i++)
segment->c[i]=ca[i];
}
return 0;
case attr_street_item:
- mr->attr_next=attr_length;
+ mr->attr_next=attr_direction;
if (seg && seg->item.map)
attr->u.item=&seg->item;
else
return 0;
return 1;
+ case attr_direction:
+ mr->attr_next=attr_length;
+ if (seg)
+ attr->u.num=seg->direction;
+ else
+ return 0;
+ return 1;
case attr_length:
if (seg)
attr->u.num=seg->length;