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) {
|
||||
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;
|
||||
|
@ -535,14 +536,17 @@ static struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
|
|||
|
||||
GetDTAttrs(bitmap->dto,
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
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 {
|
||||
gg->bm = p96AllocBitMap(width, height, 32,
|
||||
BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8);
|
||||
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend, RGBFB_A8R8G8B8);
|
||||
}
|
||||
|
||||
if(!gg->bm) warn_user("NoMemory","");
|
||||
|
|
Loading…
Reference in New Issue