diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-03-17 13:52:55 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-03-17 13:52:55 +0000 |
commit | fd84109d1bf9081fcc4f53ca25f838ac6587898f (patch) | |
tree | 8e6131c6bb0b744ac1d41d057d48779b8c2ee3ca /navit/vehicle.c | |
parent | af81dc48daec6befea39e81c2be0aa7f1eb1947d (diff) | |
download | navit-fd84109d1bf9081fcc4f53ca25f838ac6587898f.tar.gz |
Add:Core:Make optionally display a label at cursor
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4357 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicle.c')
-rw-r--r-- | navit/vehicle.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/navit/vehicle.c b/navit/vehicle.c index bec635eea..6245eaa9c 100644 --- a/navit/vehicle.c +++ b/navit/vehicle.c @@ -379,12 +379,18 @@ vehicle_draw_do(struct vehicle *this_, int lazy) int angle=this_->angle; int sequence=this_->sequence; struct attr **attr; + char *label=NULL; int match=0; if (!this_->cursor || !this_->cursor->attrs || !this_->gra) return; - + attr=this_->attrs; + while (attr && *attr) { + if ((*attr)->type == attr_name) + label=(*attr)->u.str; + attr++; + } transform_set_yaw(this_->trans, -this_->angle); graphics_draw_mode(this_->gra, draw_mode_begin); p.x=0; @@ -398,7 +404,7 @@ vehicle_draw_do(struct vehicle *this_, int lazy) if (speed >= itm->speed_range.min && speed <= itm->speed_range.max && angle >= itm->angle_range.min && angle <= itm->angle_range.max && sequence >= itm->sequence_range.min && sequence <= itm->sequence_range.max) { - graphics_draw_itemgra(this_->gra, itm, this_->trans); + graphics_draw_itemgra(this_->gra, itm, this_->trans, label); } if (sequence < itm->sequence_range.max) match=1; |