diff options
Diffstat (limited to 'frontends/amiga/icon.c')
-rw-r--r-- | frontends/amiga/icon.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c index 3f597a1ba..582d355b6 100644 --- a/frontends/amiga/icon.c +++ b/frontends/amiga/icon.c @@ -16,7 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/** \file +/** + * \file * Content for image/x-amiga-icon (icon.library implementation). * */ @@ -154,7 +155,7 @@ bool amiga_icon_convert(struct content *c) if(filename == NULL) { msg_data.error = messages_get("NoMemory"); - content_broadcast(c, CONTENT_MSG_ERROR, msg_data); + content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; } @@ -166,7 +167,7 @@ bool amiga_icon_convert(struct content *c) if(dobj == NULL) { msg_data.error = messages_get("NoMemory"); - content_broadcast(c, CONTENT_MSG_ERROR, msg_data); + content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); return false; } @@ -186,14 +187,14 @@ bool amiga_icon_convert(struct content *c) icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NEW); if (!icon_c->bitmap) { msg_data.error = messages_get("NoMemory"); - content_broadcast(c, CONTENT_MSG_ERROR, msg_data); + content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); if(dobj) FreeDiskObject(dobj); return false; } imagebuf = (ULONG *) amiga_bitmap_get_buffer(icon_c->bitmap); if (!imagebuf) { msg_data.error = messages_get("NoMemory"); - content_broadcast(c, CONTENT_MSG_ERROR, msg_data); + content_broadcast(c, CONTENT_MSG_ERROR, &msg_data); if(dobj) FreeDiskObject(dobj); return false; } @@ -273,8 +274,14 @@ bool amiga_icon_redraw(struct content *c, if (data->repeat_y) flags |= BITMAPF_REPEAT_Y; - return ctx->plot->bitmap(data->x, data->y, data->width, data->height, - icon_c->bitmap, data->background_colour, flags); + return (ctx->plot->bitmap(ctx, + icon_c->bitmap, + data->x, + data->y, + data->width, + data->height, + data->background_colour, + flags) == NSERROR_OK); } @@ -329,7 +336,10 @@ static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG if (!argbicon) return(NULL); cmap=GetColorMap(pals1); - if(!cmap) return(NULL); + if(!cmap) { + free(argbicon); + return(NULL); + } for(i=0;i<(width*height);i++) { @@ -378,7 +388,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) { @@ -499,7 +509,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); |