avoid scaled images getting incorrect mask
This commit is contained in:
parent
eaa6183567
commit
2364d68367
|
@ -477,7 +477,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
|
|||
return tbm;
|
||||
}
|
||||
|
||||
static PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
|
||||
PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height)
|
||||
{
|
||||
uint32 *bmi = (uint32 *) bitmap->pixdata;
|
||||
UBYTE maskbit = 0;
|
||||
|
|
|
@ -44,6 +44,8 @@ struct bitmap {
|
|||
|
||||
struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
|
||||
int width, int height, struct BitMap *friendbm);
|
||||
PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height);
|
||||
|
||||
Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap);
|
||||
struct bitmap *ami_bitmap_from_datatype(char *filename);
|
||||
#endif
|
||||
|
|
|
@ -3845,8 +3845,8 @@ void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
|
|||
minterm = 0xc0;
|
||||
} else {
|
||||
tag = BLITA_MaskPlane;
|
||||
tag_data = (ULONG)icon_bitmap->native_mask;
|
||||
minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
|
||||
tag_data = (ULONG)ami_bitmap_get_mask(icon_bitmap, 16, 16);
|
||||
minterm = (ABC|ABNC|ANBC);
|
||||
}
|
||||
|
||||
BltBitMapTags(BLITA_SrcX, 0,
|
||||
|
@ -3928,8 +3928,8 @@ void gui_window_set_search_ico(hlcache_handle *ico)
|
|||
minterm = 0xc0;
|
||||
} else {
|
||||
tag = BLITA_MaskPlane;
|
||||
tag_data = (ULONG)ico_bitmap->native_mask;
|
||||
minterm = 0xc0; /* should be (ABC|ABNC|ANBC); */
|
||||
tag_data = (ULONG)ami_bitmap_get_mask(ico_bitmap, 16, 16);
|
||||
minterm = (ABC|ABNC|ANBC);
|
||||
}
|
||||
|
||||
BltBitMapTags(BLITA_SrcX, 0,
|
||||
|
|
|
@ -678,10 +678,9 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
|
|||
minterm = 0xc0;
|
||||
} else {
|
||||
tag = BLITA_MaskPlane;
|
||||
tag_data = (ULONG)bitmap->native_mask;
|
||||
tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, height);
|
||||
minterm = (ABC|ABNC|ANBC);
|
||||
}
|
||||
//BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width, height, (ABC|ABNC|ANBC), bitmap->native_mask);
|
||||
|
||||
BltBitMapTags(BLITA_Width,width,
|
||||
BLITA_Height,height,
|
||||
|
@ -783,7 +782,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
|
|||
bfbm.height = height;
|
||||
bfbm.offsetx = ox;
|
||||
bfbm.offsety = oy;
|
||||
bfbm.mask = bitmap->native_mask;
|
||||
bfbm.mask = ami_bitmap_get_mask(bitmap, width, height);;
|
||||
bfh = AllocVec(sizeof(struct Hook),MEMF_CLEAR);
|
||||
bfh->h_Entry = (HOOKFUNC)ami_bitmap_tile_hook;
|
||||
bfh->h_SubEntry = 0;
|
||||
|
@ -840,7 +839,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
|
|||
} else {
|
||||
tag = BLITA_MaskPlane;
|
||||
tag_data = (ULONG)bfbm->mask;
|
||||
minterm = 0xc0; /* Should be (ABC|ABNC|ANBC) */
|
||||
minterm = (ABC|ABNC|ANBC);
|
||||
}
|
||||
|
||||
BltBitMapTags(BLITA_Width, bfbm->width,
|
||||
|
|
Loading…
Reference in New Issue