summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-10 18:30:01 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-10 18:30:01 +0100
commit2364d68367dcd6b901ec8d5e02a240ffc9b3acec (patch)
tree8f31f7debde732f32101fb67270e5e2d6782f63a /amiga
parenteaa6183567b1c9b5726a77d30e885c8b299cae6e (diff)
downloadnetsurf-2364d68367dcd6b901ec8d5e02a240ffc9b3acec.tar.gz
netsurf-2364d68367dcd6b901ec8d5e02a240ffc9b3acec.tar.bz2
avoid scaled images getting incorrect mask
Diffstat (limited to 'amiga')
-rw-r--r--amiga/bitmap.c2
-rwxr-xr-xamiga/bitmap.h2
-rwxr-xr-xamiga/gui.c8
-rwxr-xr-xamiga/plotters.c7
4 files changed, 10 insertions, 9 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index e28b21463..27be51684 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -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;
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index bf25e8ecf..87c569f85 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -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
diff --git a/amiga/gui.c b/amiga/gui.c
index 5ec38151b..d7e08f06a 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -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,
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 941587ed0..4760dcd04 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -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,