allocate our bitmaps as BMF_DISPLAYABLE as this can improve performance when blitting to the screen
This commit is contained in:
parent
e4d2677c80
commit
bc5918ebbc
|
@ -125,9 +125,9 @@ void bitmap_destroy(void *bitmap)
|
||||||
if(bm->dto) {
|
if(bm->dto) {
|
||||||
DisposeDTObject(bm->dto);
|
DisposeDTObject(bm->dto);
|
||||||
}
|
}
|
||||||
|
#ifdef AMI_CUSTOM_MASK
|
||||||
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
||||||
|
#endif
|
||||||
FreeVec(bm->pixdata);
|
FreeVec(bm->pixdata);
|
||||||
bm->pixdata = NULL;
|
bm->pixdata = NULL;
|
||||||
bm->nativebm = NULL;
|
bm->nativebm = NULL;
|
||||||
|
@ -178,8 +178,9 @@ void bitmap_modified(void *bitmap) {
|
||||||
p96FreeBitMap(bm->nativebm);
|
p96FreeBitMap(bm->nativebm);
|
||||||
|
|
||||||
if(bm->dto) DisposeDTObject(bm->dto);
|
if(bm->dto) DisposeDTObject(bm->dto);
|
||||||
|
#ifdef AMI_CUSTOM_MASK
|
||||||
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
|
||||||
|
#endif
|
||||||
bm->nativebm = NULL;
|
bm->nativebm = NULL;
|
||||||
bm->dto = NULL;
|
bm->dto = NULL;
|
||||||
bm->native_mask = NULL;
|
bm->native_mask = NULL;
|
||||||
|
@ -535,14 +536,17 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
|
||||||
|
|
||||||
GetDTAttrs(bitmap->dto,
|
GetDTAttrs(bitmap->dto,
|
||||||
PDTA_DestBitMap, &dtbm,
|
PDTA_DestBitMap, &dtbm,
|
||||||
//PDTA_MaskPlane, &bitmap->native_mask,
|
#ifndef AMI_CUSTOM_MASK
|
||||||
|
PDTA_MaskPlane, &bitmap->native_mask,
|
||||||
|
#endif
|
||||||
TAG_END);
|
TAG_END);
|
||||||
|
|
||||||
bitmap->nativebmwidth = width;
|
bitmap->nativebmwidth = width;
|
||||||
bitmap->nativebmheight = height;
|
bitmap->nativebmheight = height;
|
||||||
|
|
||||||
|
#ifdef AMI_CUSTOM_MASK
|
||||||
ami_bitmap_get_mask(bitmap, width, height);
|
ami_bitmap_get_mask(bitmap, width, height);
|
||||||
|
#endif
|
||||||
return dtbm;
|
return dtbm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,10 +154,11 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
|
||||||
gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
|
gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
|
||||||
|
|
||||||
if(palette_mapped == true) {
|
if(palette_mapped == true) {
|
||||||
gg->bm = AllocBitMap(width, height, depth, BMF_INTERLEAVED, friend);
|
gg->bm = AllocBitMap(width, height, depth,
|
||||||
|
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend);
|
||||||
} else {
|
} else {
|
||||||
gg->bm = p96AllocBitMap(width, height, 32,
|
gg->bm = p96AllocBitMap(width, height, 32,
|
||||||
BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8);
|
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend, RGBFB_A8R8G8B8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!gg->bm) warn_user("NoMemory","");
|
if(!gg->bm) warn_user("NoMemory","");
|
||||||
|
|
Loading…
Reference in New Issue