summaryrefslogtreecommitdiff
path: root/amiga/plotters.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-09-28 14:39:02 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-09-28 14:39:02 +0000
commit946115fa7640ddf8b8f81598254fb3cfcfc184f2 (patch)
tree32b1a238f3f4cc08ecb3e2e2416f361f1f22023a /amiga/plotters.c
parentbc22f2e7d4cd4089fc689c85eb4e12faa17c6cdf (diff)
downloadnetsurf-946115fa7640ddf8b8f81598254fb3cfcfc184f2.tar.gz
netsurf-946115fa7640ddf8b8f81598254fb3cfcfc184f2.tar.bz2
Stop scaled bitmaps from disappearing completely when the top of the image is
partially off-screen. Hopefully this also fixes some system freezes caused by this code when run under OS4.1 on the SAM440. svn path=/trunk/netsurf/; revision=5455
Diffstat (limited to 'amiga/plotters.c')
-rwxr-xr-xamiga/plotters.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c
index d2422357b..189eb8da4 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -239,6 +239,8 @@ bool ami_bitmap(int x, int y, int width, int height,
{
struct RenderInfo ri;
+ if(!width || !height) return true;
+
// ami_fill(x,y,x+width,y+height,bg);
SetRPAttrs(currp,RPTAG_BPenColor,p96EncodeColor(RGBFB_A8B8G8R8,bg),
@@ -248,14 +250,13 @@ bool ami_bitmap(int x, int y, int width, int height,
ri.BytesPerRow = bitmap->width * 4;
ri.RGBFormat = RGBFB_R8G8B8A8;
-/* check for black boxes under images! */
-/* disabled temporarily for SAM OS4.1
if((bitmap->width != width) || (bitmap->height != height))
{
- struct BitMap *tbm;
+ struct BitMap *tbm,*scaledbm;
struct RastPort trp;
struct BitScaleArgs bsa;
+ scaledbm = p96AllocBitMap(width,height,32,0,currp->BitMap,RGBFB_R8G8B8A8);
tbm = p96AllocBitMap(bitmap->width,bitmap->height,32,0,currp->BitMap,RGBFB_R8G8B8A8);
InitRastPort(&trp);
trp.BitMap = tbm;
@@ -264,26 +265,28 @@ bool ami_bitmap(int x, int y, int width, int height,
bsa.bsa_SrcY = 0;
bsa.bsa_SrcWidth = bitmap->width;
bsa.bsa_SrcHeight = bitmap->height;
- bsa.bsa_DestX = x;
- bsa.bsa_DestY = y;
- bsa.bsa_DestWidth = width;
- bsa.bsa_DestHeight = height;
+ bsa.bsa_DestX = 0;
+ bsa.bsa_DestY = 0;
+// bsa.bsa_DestWidth = width;
+// bsa.bsa_DestHeight = height;
bsa.bsa_XSrcFactor = bitmap->width;
bsa.bsa_XDestFactor = width;
bsa.bsa_YSrcFactor = bitmap->height;
bsa.bsa_YDestFactor = height;
bsa.bsa_SrcBitMap = tbm;
- bsa.bsa_DestBitMap = currp->BitMap;
+ bsa.bsa_DestBitMap = scaledbm;
bsa.bsa_Flags = 0;
BitMapScale(&bsa);
+ BltBitMapRastPort(scaledbm,0,0,currp,x,y,width,height,0x0C0);
+
p96FreeBitMap(tbm);
+ p96FreeBitMap(scaledbm);
}
else
{
-*/
p96WritePixelArray((struct RenderInfo *)&ri,0,0,currp,x,y,width,height);
-// }
+ }
return true;
}