Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / graphics / rectfill.c
blobf36f63f13dcca4537cc80fa30de07dc82d01f9ea
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function RectFill()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include "gfxfuncsupport.h"
10 #include <proto/oop.h>
12 /*****************************************************************************
14 NAME */
15 #include <graphics/rastport.h>
16 #include <proto/graphics.h>
18 AROS_LH5(void, RectFill,
20 /* SYNOPSIS */
21 AROS_LHA(struct RastPort *, rp, A1),
22 AROS_LHA(LONG , xMin, D0),
23 AROS_LHA(LONG , yMin, D1),
24 AROS_LHA(LONG , xMax, D2),
25 AROS_LHA(LONG , yMax, D3),
27 /* LOCATION */
28 struct GfxBase *, GfxBase, 51, Graphics)
30 /* FUNCTION
31 Fills a rectangular area with the current pens, drawing mode
32 and areafill pattern. If no areafill pattern is defined fill
33 with foreground pen.
35 INPUTS
36 rp - RastPort
37 xMin,yMin - upper left corner
38 xMax,yMax - lower right corner
40 RESULT
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
50 INTERNALS
52 HISTORY
53 29-10-95 digulla automatically created from
54 graphics_lib.fd and clib/graphics_protos.h
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
60 FIX_GFXCOORD(xMin);
61 FIX_GFXCOORD(yMin);
62 FIX_GFXCOORD(xMax);
63 FIX_GFXCOORD(yMax);
65 if ((xMax >= xMin) && (yMax >= yMin))
67 if (rp->AreaPtrn)
69 /* When rasport has areaptrn, let BltPattern do the job */
70 BltPattern(rp, NULL, xMin, yMin, xMax, yMax, 0);
73 else if (OBTAIN_DRIVERDATA(rp, GfxBase))
75 UBYTE rp_drmd;
76 HIDDT_DrawMode drmd = 0;
77 IPTR pix;
79 /* Get drawmode */
80 rp_drmd = GetDrMd(rp);
82 OOP_GetAttr(RP_DRIVERDATA(rp)->dd_GC,
83 ((rp_drmd & INVERSVID) ? aHidd_GC_Background : aHidd_GC_Foreground),
84 &pix);
86 if (rp_drmd & JAM2)
88 drmd = vHidd_GC_DrawMode_Copy;
90 else if (rp_drmd & COMPLEMENT)
92 drmd = vHidd_GC_DrawMode_Invert;
94 else if ((rp_drmd & (~INVERSVID)) == JAM1)
96 drmd = vHidd_GC_DrawMode_Copy;
99 fillrect_pendrmd(rp, xMin, yMin, xMax, yMax, pix, drmd, TRUE, GfxBase);
101 RELEASE_DRIVERDATA(rp, GfxBase);
104 } /* if ((xMax >= xMin) && (yMax >= yMin)) */
106 AROS_LIBFUNC_EXIT
108 } /* RectFill */