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 | 0eb6208d73b39272a02b75ab5d13ef32eb5bfab9 (patch) | |
tree | 8e6131c6bb0b744ac1d41d057d48779b8c2ee3ca /navit/vehicle.c | |
parent | e89863834387c07ec4a6d6dc2fe6ca6a21ff8366 (diff) | |
download | navit-svn-0eb6208d73b39272a02b75ab5d13ef32eb5bfab9.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 bec635ee..6245eaa9 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; |