diff options
-rw-r--r-- | navit/navit.c | 2 | ||||
-rw-r--r-- | navit/vehicle.c | 8 | ||||
-rw-r--r-- | navit/vehicle.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/navit/navit.c b/navit/navit.c index de342bb86..73a581070 100644 --- a/navit/navit.c +++ b/navit/navit.c @@ -1750,7 +1750,7 @@ navit_set_cursors(struct navit *this_) c=layout_get_cursor(this_->layout_current, name.u.str); } else c=layout_get_cursor(this_->layout_current, "default"); - vehicle_set_cursor(nv->vehicle, c); + vehicle_set_cursor(nv->vehicle, c, 0); v=g_list_next(v); } return; diff --git a/navit/vehicle.c b/navit/vehicle.c index ae404fc0c..bec635eea 100644 --- a/navit/vehicle.c +++ b/navit/vehicle.c @@ -50,6 +50,7 @@ struct vehicle { // cursor struct cursor *cursor; + int cursor_fixed; struct callback *animate_callback; struct event_timeout *animate_timer; struct point cursor_pnt; @@ -235,7 +236,8 @@ vehicle_add_attr(struct vehicle *this_, struct attr *attr) break; // currently supporting oldstyle cursor config. case attr_cursor: - vehicle_set_cursor(this_, attr->u.cursor); + this_->cursor_fixed=1; + vehicle_set_cursor(this_, attr->u.cursor, 1); break; default: break; @@ -284,9 +286,11 @@ vehicle_remove_attr(struct vehicle *this_, struct attr *attr) * @author Ralph Sennhauser (10/2009) */ void -vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor) +vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite) { struct point sc; + if (this_->cursor_fixed && !overwrite) + return; if (this_->animate_callback) { event_remove_timeout(this_->animate_timer); this_->animate_timer=NULL; // dangling pointer! prevent double freeing. diff --git a/navit/vehicle.h b/navit/vehicle.h index 3c1dcda1c..d2a52a426 100644 --- a/navit/vehicle.h +++ b/navit/vehicle.h @@ -49,7 +49,7 @@ int vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *at int vehicle_set_attr(struct vehicle *this_, struct attr *attr); int vehicle_add_attr(struct vehicle *this_, struct attr *attr); int vehicle_remove_attr(struct vehicle *this_, struct attr *attr); -void vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor); +void vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite); void vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int lazy, int angle, int speed); int vehicle_get_cursor_data(struct vehicle *this_, struct point *pnt, int *angle, int *speed); void vehicle_log_gpx_add_tag(char *tag, char **logstr); |