debug.library: use quick sort to sort the segments
[AROS.git] / rom / graphics / clearregionregion.c
blob19335b1f2d9a11f4898cd076a08928d35d7bf5fb
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: (AROS only) Graphics function ClearRegionRegion()
6 Lang: english
7 */
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
11 #include <graphics/regions.h>
12 #include "intregions.h"
14 /*****************************************************************************
16 NAME */
17 #include <clib/graphics_protos.h>
19 AROS_LH2(BOOL, ClearRegionRegion,
21 /* SYNOPSIS */
22 AROS_LHA(struct Region *, R1, A0),
23 AROS_LHA(struct Region *, R2, A1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 182, Graphics)
28 /* FUNCTION
29 Clear the given Region region1 from the given Region region2
30 leaving the result in region2.
32 INPUTS
33 region1 - pointer to a Region structure
34 region2 - pointer to a Rectangle structure
36 RESULT
37 FALSE if not enough memory was available, else TRUE
39 NOTES
40 This function does not exist in AmigaOS.
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 ClearRectRegion(), AndRectRegion(), OrRectRegion(), XorRectRegion()
49 INTERNALS
51 HISTORY
52 13-12-2000 stegerg implemented
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct Region R3;
60 /* If the regions don't overlap just return */
61 if (!overlap(R1->bounds, R2->bounds))
62 return TRUE;
64 InitRegion(&R3);
68 _DoOperationBandBand
70 _ClearBandBand,
71 MinX(R1),
72 MinX(R2),
73 MinY(R1),
74 MinY(R2),
75 R1->RegionRectangle,
76 R2->RegionRectangle,
77 &R3.RegionRectangle,
78 &R3.bounds,
79 GfxBase
83 ClearRegion(R2);
85 *R2 = R3;
87 _TranslateRegionRectangles(R3.RegionRectangle, -MinX(&R3), -MinY(&R3));
89 return TRUE;
92 return FALSE;
94 AROS_LIBFUNC_EXIT
96 } /* ClearRegionRegion */