summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit.c6
-rw-r--r--route.c6
-rw-r--r--route.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/navit.c b/navit.c
index 8cf7454a..3ccc09c7 100644
--- a/navit.c
+++ b/navit.c
@@ -1168,6 +1168,7 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv)
struct point cursor_pnt, *pnt=&cursor_pnt;
enum projection pro;
int border=16;
+ int route_path_set=0;
if (! this_->ready)
return;
@@ -1184,6 +1185,8 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv)
navit_vehicle_draw(this_, nv, NULL);
return;
}
+ if (this_->route)
+ route_path_set=route_get_path_set(this_->route);
if (this_->tracking && this_->tracking_flag) {
if (tracking_update(this_->tracking, &nv->coord, nv->dir)) {
if (this_->route && nv->update_curr == 1)
@@ -1197,7 +1200,6 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv)
route_set_position(this_->route, &cursor_pc);
}
}
-
transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 0);
if (!transform_within_border(this_->trans, &cursor_pnt, border)) {
if (!this_->cursor_flag)
@@ -1219,6 +1221,8 @@ navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv)
navit_set_center_cursor(this_, &nv->coord, nv->dir, 50, 80);
pnt=NULL;
}
+ if (pnt && this_->route && !route_path_set && route_get_path_set(this_->route))
+ navit_draw(this_);
if (nv->follow_curr > 1)
nv->follow_curr--;
else
diff --git a/route.c b/route.c
index 61dac6d7..7d4866ad 100644
--- a/route.c
+++ b/route.c
@@ -188,6 +188,12 @@ route_get_speedlist(struct route *this)
}
int
+route_get_path_set(struct route *this)
+{
+ return this->path2 != NULL;
+}
+
+int
route_set_speed(struct route *this, enum item_type type, int value)
{
if (type < route_item_first || type > route_item_last) {
diff --git a/route.h b/route.h
index 06575e05..d6a60b44 100644
--- a/route.h
+++ b/route.h
@@ -43,6 +43,7 @@ struct mapset *route_get_mapset(struct route *this);
struct route_info *route_get_pos(struct route *this);
struct route_info *route_get_dst(struct route *this);
int *route_get_speedlist(struct route *this);
+int route_get_path_set(struct route *this);
int route_set_speed(struct route *this, enum item_type type, int value);
int route_contains(struct route *this, struct item *item);
void route_set_position(struct route *this, struct pcoord *pos);