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;
// cursor
struct cursor *cursor;
+ int cursor_fixed;
struct callback *animate_callback;
struct event_timeout *animate_timer;
struct point cursor_pnt;
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;
* @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.
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);