From 5a58e844e43b397b3154d5635859fe1d78c27877 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 21 Jan 2016 22:02:39 +0000 Subject: [PATCH] Don't clear bitmap structure on allocation --- amiga/bitmap.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 6984d3e0c..cc71ccd64 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -49,16 +49,21 @@ void *amiga_bitmap_create(int width, int height, unsigned int state) { struct bitmap *bitmap; - bitmap = ami_misc_allocvec_clear(sizeof(struct bitmap), 0); - if(bitmap) - { - bitmap->pixdata = ami_misc_allocvec_clear(width*height*4, 0xff); - bitmap->width = width; - bitmap->height = height; + bitmap = AllocVecTagList(sizeof(struct bitmap), NULL); + if(bitmap == NULL) return NULL; - if(state & BITMAP_OPAQUE) bitmap->opaque = true; - else bitmap->opaque = false; - } + bitmap->pixdata = ami_misc_allocvec_clear(width*height*4, 0xff); + bitmap->width = width; + bitmap->height = height; + + if(state & BITMAP_OPAQUE) bitmap->opaque = true; + else bitmap->opaque = false; + + bitmap->nativebm = NULL; + bitmap->nativebmwidth = 0; + bitmap->nativebmheight = 0; + bitmap->native_mask = NULL; + bitmap->dto = NULL; return bitmap; }