picture.datatype: gi_RastPort should not be directly accessed
[AROS.git] / rom / graphics / rectfill.c
blob3f872495cd884571db588821ede117405615ff14
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function RectFill()
6 Lang: english
7 */
9 #include <proto/oop.h>
11 #include "graphics_intern.h"
12 #include "gfxfuncsupport.h"
13 #include "graphics_driver.h"
15 /*****************************************************************************
17 NAME */
18 #include <graphics/rastport.h>
19 #include <proto/graphics.h>
21 AROS_LH5(void, RectFill,
23 /* SYNOPSIS */
24 AROS_LHA(struct RastPort *, rp, A1),
25 AROS_LHA(LONG , xMin, D0),
26 AROS_LHA(LONG , yMin, D1),
27 AROS_LHA(LONG , xMax, D2),
28 AROS_LHA(LONG , yMax, D3),
30 /* LOCATION */
31 struct GfxBase *, GfxBase, 51, Graphics)
33 /* FUNCTION
34 Fills a rectangular area with the current pens, drawing mode
35 and areafill pattern. If no areafill pattern is defined fill
36 with foreground pen.
38 INPUTS
39 rp - RastPort
40 xMin,yMin - upper left corner
41 xMax,yMax - lower right corner
43 RESULT
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
53 INTERNALS
55 HISTORY
56 29-10-95 digulla automatically created from
57 graphics_lib.fd and clib/graphics_protos.h
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
63 FIX_GFXCOORD(xMin);
64 FIX_GFXCOORD(yMin);
65 FIX_GFXCOORD(xMax);
66 FIX_GFXCOORD(yMax);
68 if ((xMax >= xMin) && (yMax >= yMin))
70 if (rp->AreaPtrn)
72 /* When rasport has areaptrn, let BltPattern do the job */
73 BltPattern(rp, NULL, xMin, yMin, xMax, yMax, 0);
75 else
77 OOP_Object *gc = GetDriverData(rp, GfxBase);
78 struct Rectangle rr;
79 HIDDT_Pixel oldfg;
81 if (rp->DrawMode & INVERSVID) {
82 oldfg = GC_FG(gc);
83 GC_FG(gc) = GC_BG(gc);
86 /* This is the same as fillrect_pendrmd() */
88 rr.MinX = xMin;
89 rr.MinY = yMin;
90 rr.MaxX = xMax;
91 rr.MaxY = yMax;
93 do_render_with_gc(rp, NULL, &rr, fillrect_render, NULL, gc, TRUE, FALSE, GfxBase);
95 if (rp->DrawMode & INVERSVID) {
96 GC_FG(gc) = oldfg;
99 } /* if ((xMax >= xMin) && (yMax >= yMin)) */
101 AROS_LIBFUNC_EXIT
103 } /* RectFill */