From bc5918ebbc01a4d5022c8b3b308af41318097c84 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 9 Aug 2012 22:31:10 +0100 Subject: allocate our bitmaps as BMF_DISPLAYABLE as this can improve performance when blitting to the screen --- amiga/bitmap.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'amiga/bitmap.c') diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 53de5cf4f..4d20fb4d1 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -125,9 +125,9 @@ void bitmap_destroy(void *bitmap) if(bm->dto) { DisposeDTObject(bm->dto); } - +#ifdef AMI_CUSTOM_MASK if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height); - +#endif FreeVec(bm->pixdata); bm->pixdata = NULL; bm->nativebm = NULL; @@ -178,8 +178,9 @@ void bitmap_modified(void *bitmap) { p96FreeBitMap(bm->nativebm); if(bm->dto) DisposeDTObject(bm->dto); +#ifdef AMI_CUSTOM_MASK if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height); - +#endif bm->nativebm = NULL; bm->dto = NULL; bm->native_mask = NULL; @@ -485,7 +486,7 @@ static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height if(bitmap->native_mask) return bitmap->native_mask; bitmap->native_mask = AllocRaster(width, height); - + for(y=0; ydto, PDTA_DestBitMap, &dtbm, - //PDTA_MaskPlane, &bitmap->native_mask, +#ifndef AMI_CUSTOM_MASK + PDTA_MaskPlane, &bitmap->native_mask, +#endif TAG_END); bitmap->nativebmwidth = width; bitmap->nativebmheight = height; - + +#ifdef AMI_CUSTOM_MASK ami_bitmap_get_mask(bitmap, width, height); - +#endif return dtbm; } -- cgit v1.2.3