summaryrefslogtreecommitdiff
path: root/navit/route.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-06-15 19:53:24 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-06-15 19:53:24 +0000
commit93280efbe81b3c42cbfd40020ad53bee0c6cd818 (patch)
treecd11be6284ec7b0610b6d06bd794ded39b28f0bc /navit/route.c
parentaeb22fff6a01ab7fb95f4226aab7321553ee9233 (diff)
downloadnavit-93280efbe81b3c42cbfd40020ad53bee0c6cd818.tar.gz
Fix:Core:Improved tracking to compensate for gps receivers with static navigation disabled
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2317 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/route.c')
-rw-r--r--navit/route.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/navit/route.c b/navit/route.c
index 66b8315d5..f405c31a5 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -559,22 +559,12 @@ route_contains(struct route *this, struct item *item)
{
if (! this->path2 || !this->path2->path_hash)
return 0;
- return (int)(long)item_hash_lookup(this->path2->path_hash, item);
-}
-
-/**
- * @brief Checks if the current position in a route is a certain item
- *
- * @param this The route to check for this item
- * @param item The item to search for
- * @return True if the current position is this item, false otherwise
- */
-int
-route_pos_contains(struct route *this, struct item *item)
-{
+ if (item_hash_lookup(this->path2->path_hash, item))
+ return 1;
if (! this->pos || !this->pos->street)
return 0;
return item_is_equal(this->pos->street->item, *item);
+
}
/**
@@ -742,9 +732,9 @@ route_set_position(struct route *this, struct pcoord *pos)
* @param tracking The tracking to get the coordinates from
*/
void
-route_set_position_from_tracking(struct route *this, struct tracking *tracking)
+route_set_position_from_tracking(struct route *this, struct tracking *tracking, enum projection pro)
{
- struct pcoord *c;
+ struct coord *c;
struct route_info *ret;
struct street_data *sd;
@@ -758,15 +748,13 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking)
if (this->pos)
route_info_free(this->pos);
this->pos=NULL;
- ret->c.x = c->x;
- ret->c.y = c->y;
- ret->lp.x=c->x;
- ret->lp.y=c->y;
+ ret->c=*c;
+ ret->lp=*c;
ret->pos=tracking_get_segment_pos(tracking);
sd=tracking_get_street_data(tracking);
if (sd) {
ret->street=street_data_dup(sd);
- route_info_distances(ret, c->pro);
+ route_info_distances(ret, pro);
}
dbg(3,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)\n", c->x, c->y, ret->pos, ret->street->item.id_hi, ret->street->item.id_lo);
dbg(3,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)\n", ret->street->c[0].x, ret->street->c[0].y, ret->street->count-1, ret->street->c[ret->street->count-1].x, ret->street->c[ret->street->count-1].y);