From 0c32cbb7cb942a3c5845064701f04dc5b413dfad Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 13 Feb 2017 18:41:38 +0000 Subject: Try to ensure we get the correct type of native BitMap --- frontends/amiga/bitmap.c | 4 ++-- frontends/amiga/bitmap.h | 2 +- frontends/amiga/gui.c | 4 ++-- frontends/amiga/icon.c | 4 ++-- frontends/amiga/plotters.c | 4 ++-- frontends/amiga/theme.c | 4 +++- 6 files changed, 12 insertions(+), 10 deletions(-) (limited to 'frontends/amiga') diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index 24471c31f..533b416fa 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -703,11 +703,11 @@ static inline struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap, } struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap, - int width, int height, struct BitMap *friendbm) + int width, int height, bool palette_mapped, struct BitMap *friendbm) { if(bitmap == NULL) return NULL; - if(__builtin_expect(ami_plot_screen_is_palettemapped() == true, 0)) { + if(__builtin_expect(palette_mapped == true, 0)) { return ami_bitmap_get_palettemapped(bitmap, width, height, friendbm); } else { return ami_bitmap_get_truecolour(bitmap, width, height, friendbm); diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h index 056953fa9..17939d79a 100755 --- a/frontends/amiga/bitmap.h +++ b/frontends/amiga/bitmap.h @@ -34,7 +34,7 @@ struct nsurl; struct gui_globals; struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap, - int width, int height, struct BitMap *friendbm); + int width, int height, bool palette_mapped, struct BitMap *friendbm); PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height, struct BitMap *n_bm); diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index eb6be4ce6..e8a13d780 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1810,7 +1810,7 @@ static void gui_window_set_icon(struct gui_window *g, struct hlcache_handle *ico if ((icon != NULL) && ((icon_bitmap = content_get_bitmap(icon)) != NULL)) { - bm = ami_bitmap_get_native(icon_bitmap, 16, 16, + bm = ami_bitmap_get_native(icon_bitmap, 16, 16, ami_plot_screen_is_palettemapped(), g->shared->win->RPort->BitMap); } @@ -5135,7 +5135,7 @@ static nserror gui_search_web_provider_update(const char *provider_name, if(nsoption_bool(kiosk_mode) == true) return NSERROR_BAD_PARAMETER; if (ico_bitmap != NULL) { - bm = ami_bitmap_get_native(ico_bitmap, 16, 16, NULL); + bm = ami_bitmap_get_native(ico_bitmap, 16, 16, ami_plot_screen_is_palettemapped(), NULL); } if(bm == NULL) return NSERROR_BAD_PARAMETER; diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c index a92b8674c..6521854ee 100644 --- a/frontends/amiga/icon.c +++ b/frontends/amiga/icon.c @@ -385,7 +385,7 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct if(format != IDFMT_DIRECTMAPPED) return; #ifdef __amigaos4__ if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) { - bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, NULL); + bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, false, NULL); } if(bm) { @@ -506,7 +506,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm) if(bm) { bitmap = ami_bitmap_get_native(bm, THUMBNAIL_WIDTH, - THUMBNAIL_HEIGHT, NULL); + THUMBNAIL_HEIGHT, false, NULL); icondata = malloc(THUMBNAIL_WIDTH * 4 * THUMBNAIL_HEIGHT); ami_bitmap_set_icondata(bm, icondata); diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c index 0b41dea92..8a88917b8 100644 --- a/frontends/amiga/plotters.c +++ b/frontends/amiga/plotters.c @@ -451,7 +451,7 @@ ami_bitmap(struct gui_globals *glob, int x, int y, int width, int height, struct return NSERROR_OK; } - tbm = ami_bitmap_get_native(bitmap, width, height, glob->rp->BitMap); + tbm = ami_bitmap_get_native(bitmap, width, height, glob->palette_mapped, glob->rp->BitMap); if (!tbm) { return NSERROR_OK; } @@ -1051,7 +1051,7 @@ ami_bitmap_tile(const struct redraw_context *ctx, return NSERROR_OK; } - tbm = ami_bitmap_get_native(bitmap, width, height, glob->rp->BitMap); + tbm = ami_bitmap_get_native(bitmap, width, height, glob->palette_mapped, glob->rp->BitMap); if (!tbm) { return NSERROR_OK; } diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c index 496fc5470..5e4be0710 100644 --- a/frontends/amiga/theme.c +++ b/frontends/amiga/theme.c @@ -47,6 +47,7 @@ #include "amiga/gui.h" #include "amiga/drag.h" #include "amiga/bitmap.h" +#include "amiga/plotters.h" #include "amiga/schedule.h" #include "amiga/theme.h" #include "amiga/misc.h" @@ -179,7 +180,8 @@ void ami_theme_throbber_setup(void) if(throbber_update_interval == 0) throbber_update_interval = 250; bm = ami_bitmap_from_datatype(throbberfile); - throbber = ami_bitmap_get_native(bm, bitmap_get_width(bm), bitmap_get_height(bm), NULL); + throbber = ami_bitmap_get_native(bm, bitmap_get_width(bm), bitmap_get_height(bm), + ami_plot_screen_is_palettemapped(), NULL); throbber_nsbm = bm; } -- cgit v1.2.3