summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wildemann <gta04@metalstrolche.de>2019-09-22 23:41:38 +0200
committerWildemann Stefan <stefan.wildemann@corpuls.com>2019-09-23 10:45:08 +0200
commit8c8238eb65dc9a7587f6c83bd2f797bb04da57ea (patch)
tree4ff0f9df566466c43470ff50fb0e769bf48f4ab2
parent9bfeb7edd653d5d983483a4a3a2befc5a3c38b04 (diff)
downloadnavit-8c8238eb65dc9a7587f6c83bd2f797bb04da57ea.tar.gz
enhancement:graphics:draw tunnel types transparent
-rw-r--r--navit/graphics.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/navit/graphics.c b/navit/graphics.c
index 784ca5540..c502dcec9 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -1366,6 +1366,7 @@ struct displayitem {
char *label;
struct displayitem_poly_holes * holes;
int z_order;
+ int flags;
int count;
struct coord c[0];
};
@@ -1433,6 +1434,7 @@ static void display_add(struct hash_entry *entry, struct item *item, int count,
int hole_count=0;
int hole_total_coords=0;
int holes_length;
+ int flags=0;
/* calculate number of bytes required */
/* own length */
@@ -1446,6 +1448,11 @@ static void display_add(struct hash_entry *entry, struct item *item, int count,
len++;
}
}
+ /* check for and remember flags (for underground drawing) */
+ item_attr_rewind(item);
+ if(item_attr_get(item, attr_flags, &attr)) {
+ flags = attr.u.num;
+ }
/* add length for holes */
item_attr_rewind(item);
while(item_attr_get(item, attr_poly_hole, &attr)) {
@@ -1464,6 +1471,7 @@ static void display_add(struct hash_entry *entry, struct item *item, int count,
p+=sizeof(*di)+count*sizeof(*c);
di->item=*item;
di->z_order=0;
+ di->flags=flags;
di->holes=NULL;
if(hole_count > 0) {
di->holes = display_add_holes(item, hole_count, &p);
@@ -2676,10 +2684,15 @@ static void displayitem_draw(struct displayitem *di, void *dummy, struct display
if (! dc->gc) {
struct graphics_gc * gc=graphics_gc_new(gra);
- graphics_gc_set_foreground(gc, &e->color);
dc->gc=gc;
}
-
+ if((di->flags & AF_UNDERGROUND) && (dc->e->type != element_text)) {
+ struct color fg_color = e->color;
+ fg_color.a=0x33 << 8;
+ graphics_gc_set_foreground(dc->gc, &fg_color);
+ } else {
+ graphics_gc_set_foreground(dc->gc, &e->color);
+ }
if (item_type_is_area(dc->type) && (dc->e->type == element_polyline || dc->e->type == element_text))
limit = 0;