From be4878e1fe39c53b09972586cb1d995a08e769e2 Mon Sep 17 00:00:00 2001 From: Sebastian Leske Date: Wed, 2 Sep 2015 18:38:44 +0200 Subject: Refactor:remove param 'alpha' from graphics_overlay_new/resize --- navit/graphics.c | 11 +++++------ navit/graphics.h | 4 ++-- navit/osd.c | 4 ++-- navit/vehicle.c | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/navit/graphics.c b/navit/graphics.c index 558090994..d7c4e9dd3 100644 --- a/navit/graphics.c +++ b/navit/graphics.c @@ -298,14 +298,14 @@ int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr * * @returns new overlay * @author Martin Schaller (04/2008) */ -struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound) +struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int wraparound) { struct graphics *this_; struct point_rect pr; if (!parent->meth.overlay_new) return NULL; this_=g_new0(struct graphics, 1); - this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, alpha, wraparound); + this_->priv=parent->meth.overlay_new(parent->priv, &this_->meth, p, w, h, 65535, wraparound); this_->image_cache_hash = parent->image_cache_hash; this_->parent = parent; pr.lu.x=0; @@ -322,23 +322,22 @@ struct graphics * graphics_overlay_new(struct graphics *parent, struct point *p, } /** - * @brief Alters the size, position, alpha and wraparound for an overlay + * @brief Alters the size, position and wraparound for an overlay * * @param this_ The overlay's graphics struct * @param p The new position of the overlay * @param w The new width of the overlay * @param h The new height of the overlay - * @param alpha The new alpha of the overlay * @param wraparound The new wraparound of the overlay */ void -graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int alpha, int wraparound) +graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int wraparound) { if (! this_->meth.overlay_resize) { return; } - this_->meth.overlay_resize(this_->priv, p, w, h, alpha, wraparound); + this_->meth.overlay_resize(this_->priv, p, w, h, 65535, wraparound); } static void diff --git a/navit/graphics.h b/navit/graphics.h index a9268e07a..fc72fb3b8 100644 --- a/navit/graphics.h +++ b/navit/graphics.h @@ -155,8 +155,8 @@ int graphics_set_attr(struct graphics *gra, struct attr *attr); void graphics_set_rect(struct graphics *gra, struct point_rect *pr); struct graphics *graphics_new(struct attr *parent, struct attr **attrs); int graphics_get_attr(struct graphics *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); -struct graphics *graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int alpha, int wraparound); -void graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int alpha, int wraparound); +struct graphics *graphics_overlay_new(struct graphics *parent, struct point *p, int w, int h, int wraparound); +void graphics_overlay_resize(struct graphics *this_, struct point *p, int w, int h, int wraparound); void graphics_init(struct graphics *this_); void *graphics_get_data(struct graphics *this_, const char *type); void graphics_add_callback(struct graphics *this_, struct callback *cb); diff --git a/navit/osd.c b/navit/osd.c index 4d5527b86..dd87392fb 100644 --- a/navit/osd.c +++ b/navit/osd.c @@ -158,7 +158,7 @@ osd_std_click(struct osd_item *this, struct navit *nav, int pressed, int button, void osd_std_resize(struct osd_item *item) { - graphics_overlay_resize(item->gr, &item->p, item->w, item->h, 65535, 1); + graphics_overlay_resize(item->gr, &item->p, item->w, item->h, 1); } /** @@ -373,7 +373,7 @@ osd_set_std_graphic(struct navit *nav, struct osd_item *item, struct osd_priv *p navit_gr = navit_get_graphics(nav); osd_std_calculate_sizes(item, navit_get_width(nav), navit_get_height(nav)); - item->gr = graphics_overlay_new(navit_gr, &item->p, item->w, item->h, 65535, 1); + item->gr = graphics_overlay_new(navit_gr, &item->p, item->w, item->h, 1); item->graphic_bg = graphics_gc_new(item->gr); graphics_gc_set_foreground(item->graphic_bg, &item->color_bg); diff --git a/navit/vehicle.c b/navit/vehicle.c index be8bd1bdd..a280fb024 100644 --- a/navit/vehicle.c +++ b/navit/vehicle.c @@ -339,7 +339,7 @@ vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite) if (cursor && this_->gra && this_->cursor) { this_->cursor_pnt.x+=(this_->cursor->w - cursor->w)/2; this_->cursor_pnt.y+=(this_->cursor->h - cursor->h)/2; - graphics_overlay_resize(this_->gra, &this_->cursor_pnt, cursor->w, cursor->h, 65535, 0); + graphics_overlay_resize(this_->gra, &this_->cursor_pnt, cursor->w, cursor->h, 0); } if (cursor) { @@ -382,7 +382,7 @@ vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int this_->cursor_pnt.y-=this_->cursor->h/2; if (!this_->gra) { struct color c; - this_->gra=graphics_overlay_new(gra, &this_->cursor_pnt, this_->cursor->w, this_->cursor->h, 65535, 0); + this_->gra=graphics_overlay_new(gra, &this_->cursor_pnt, this_->cursor->w, this_->cursor->h, 0); if (this_->gra) { graphics_init(this_->gra); this_->bg=graphics_gc_new(this_->gra); -- cgit v1.2.1