move registering of the ROM region after prepare execbase. rename i386-pc's kernel...
[AROS.git] / rom / graphics / eraserect.c
blobda9905afe02be2afcc8102e4ea7841a38fdc1dca
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function EraseRect()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <graphics/rastport.h>
11 #include <aros/asmcall.h>
12 #include <utility/hooks.h>
13 #include <proto/oop.h>
14 #include <proto/layers.h>
15 #include "gfxfuncsupport.h"
17 #define LayersBase (struct LayersBase *)(GfxBase->gb_LayersBase)
19 /*****************************************************************************
21 NAME */
22 #include <graphics/rastport.h>
23 #include <proto/graphics.h>
25 AROS_LH5(void, EraseRect,
27 /* SYNOPSIS */
28 AROS_LHA(struct RastPort *, rp, A1),
29 AROS_LHA(LONG , xMin, D0),
30 AROS_LHA(LONG , yMin, D1),
31 AROS_LHA(LONG , xMax, D2),
32 AROS_LHA(LONG , yMax, D3),
34 /* LOCATION */
35 struct GfxBase *, GfxBase, 135, Graphics)
37 /* FUNCTION
38 Fill a rectangular area with the current BackFill hook.
39 If layered the BackFill hook is used.
40 If non-layered the region is cleared.
42 INPUTS
43 rp - destination RastPort
44 xMin,yMin - upper left corner
45 xMax,YMax - lower right corner
47 RESULT
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
57 INTERNALS
59 HISTORY
60 29-10-95 digulla automatically created from
61 graphics_lib.fd and clib/graphics_protos.h
63 *****************************************************************************/
65 AROS_LIBFUNC_INIT
67 struct Rectangle r;
68 struct Hook *h = LAYERS_BACKFILL;
70 if (!LayersBase) {
71 rp->DrawMode ^= INVERSVID;
72 RectFill(rp, xMin, yMin, xMax, yMax);
73 rp->DrawMode ^= INVERSVID;
74 return;
77 FIX_GFXCOORD(xMin);
78 FIX_GFXCOORD(yMin);
79 FIX_GFXCOORD(xMax);
80 FIX_GFXCOORD(yMax);
82 r.MinX = xMin;
83 r.MinY = yMin;
84 r.MaxX = xMax;
85 r.MaxY = yMax;
87 if (rp->Layer)
89 LockLayerRom(rp->Layer);
90 h = rp->Layer->BackFill;
93 DoHookClipRects(h, rp, &r);
95 if (rp->Layer)
97 UnlockLayerRom(rp->Layer);
100 ReturnVoid("EraseRect");
102 AROS_LIBFUNC_EXIT
104 } /* EraseRect */
106 /****************************************************************************************/
108 #undef LayersBase
110 /****************************************************************************************/