From c0d031bf735559ad1d49ce4d3773ef4788f5a096 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 25 Jan 2016 00:01:55 +0000 Subject: Make the palette-mapped state relate to the rendering layer rather than globally. This means we can still render in 32-bit mode internally when the destination isn't the screen. NB: bitmap_render is currently freezing when the screen is in palette-mapped mode (old bug, pre-dates this change), so for now we skip this routine in that scenario. --- amiga/bitmap.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'amiga/bitmap.c') diff --git a/amiga/bitmap.c b/amiga/bitmap.c index ae9479d26..dd6a91b67 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -534,11 +534,7 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap, static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content) { - int plot_width; - int plot_height; - struct MinList shared_pens; - struct gui_globals bm_globals; - struct gui_globals *temp_gg = glob; + if(ami_plot_screen_is_palettemapped() == true) return NSERROR_OK; struct redraw_context ctx = { .interactive = false, @@ -546,13 +542,18 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content) .plot = &amiplot }; + int plot_width; + int plot_height; + struct gui_globals bm_globals; + struct gui_globals *temp_gg = glob; +// struct MinList *shared_pens = ami_AllocMinList(); + plot_width = MIN(content_get_width(content), bitmap->width); plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) / bitmap->width; - ami_init_layers(&bm_globals, bitmap->width, bitmap->height); - ami_NewMinList(&shared_pens); - bm_globals.shared_pens = &shared_pens; + ami_init_layers(&bm_globals, bitmap->width, bitmap->height, true); +// bm_globals.shared_pens = shared_pens; glob = &bm_globals; ami_clearclipreg(&bm_globals); @@ -582,7 +583,8 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content) to try to avoid re-conversion (at the expense of memory) */ ami_free_layers(&bm_globals); - ami_plot_release_pens(&shared_pens); +// ami_plot_release_pens(shared_pens); +// FreeVec(shared_pens); amiga_bitmap_set_opaque(bitmap, true); /* Restore previous render area. This is set when plotting starts, -- cgit v1.2.3