New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / graphics / rectfill.c
blobd3ebede96d985684d8d841b3e840997dcdefc950
1 /*
2 Copyright © 1995-2001, 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
32 INPUTS
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 HISTORY
47 29-10-95 digulla automatically created from
48 graphics_lib.fd and clib/graphics_protos.h
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
53 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
55 FIX_GFXCOORD(xMin);
56 FIX_GFXCOORD(yMin);
57 FIX_GFXCOORD(xMax);
58 FIX_GFXCOORD(yMax);
60 if ((xMax >= xMin) && (yMax >= yMin))
62 if (rp->AreaPtrn)
64 /* When rasport has areaptrn, let BltPattern do the job */
65 BltPattern(rp, NULL, xMin, yMin, xMax, yMax, 0);
68 else if (OBTAIN_DRIVERDATA(rp, GfxBase))
70 UBYTE rp_drmd;
71 HIDDT_DrawMode drmd = 0;
72 IPTR pix;
74 /* Get drawmode */
75 rp_drmd = GetDrMd(rp);
77 OOP_GetAttr(RP_DRIVERDATA(rp)->dd_GC,
78 ((rp_drmd & INVERSVID) ? aHidd_GC_Background : aHidd_GC_Foreground),
79 &pix);
81 if (rp_drmd & JAM2)
83 drmd = vHidd_GC_DrawMode_Copy;
85 else if (rp_drmd & COMPLEMENT)
87 drmd = vHidd_GC_DrawMode_Invert;
89 else if ((rp_drmd & (~INVERSVID)) == JAM1)
91 drmd = vHidd_GC_DrawMode_Copy;
94 fillrect_pendrmd(rp, xMin, yMin, xMax, yMax, pix, drmd, GfxBase);
96 RELEASE_DRIVERDATA(rp, GfxBase);
99 } /* if ((xMax >= xMin) && (yMax >= yMin)) */
101 AROS_LIBFUNC_EXIT
103 } /* RectFill */