abstract the native bitmap fetcher functions, and make the favicon collection use the new one.

This commit is contained in:
Chris Young 2012-08-07 21:09:49 +01:00
parent 391d483c9d
commit dd7935bb1f
3 changed files with 12 additions and 2 deletions

View File

@ -351,7 +351,15 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
return bm;
}
struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
int width, int height, struct BitMap *friendbm)
{
if(ami_plot_screen_is_palettemapped() == true) {
return ami_bitmap_get_palettemapped(bitmap, width, height);
} else {
return ami_getcachenativebm(bitmap, width, height, friendbm);
}
}
struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm)
{

View File

@ -42,6 +42,8 @@ struct bitmap {
ULONG *icondata; /* for appicons */
};
struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
int width, int height, struct BitMap *friendbm);
struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm);
struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap, int width, int height);

View File

@ -3823,7 +3823,7 @@ void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
if ((icon != NULL) && (content_get_bitmap(icon) != NULL))
{
bm = ami_getcachenativebm(content_get_bitmap(icon), 16, 16,
bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16,
g->shared->win->RPort->BitMap);
}