Fixed a warning (missing type cast)
[tangerine.git] / rom / graphics / clearregionregionnd.c
blob9f13b807c46baa8fd0290152bb13ba8c92f9b5a8
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AndRegionRegion()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include "intregions.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/graphics.h>
17 AROS_LH2(struct Region *, ClearRegionRegionND,
19 /* SYNOPSIS */
20 AROS_LHA(struct Region *, R1, A0),
21 AROS_LHA(struct Region *, R2, A1),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 141, Graphics)
26 /* FUNCTION
27 Clear the given Region region1 from the given Region region2.
29 INPUTS
30 region1 - pointer to a region structure
31 region2 - pointer to a region structure
33 RESULT
34 The resulting region or NULL in case there's no enough free memory
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 XorRegionRegion(), OrRegionRegion()
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct Region *R3;
57 !R1->RegionRectangle ||
58 !R2->RegionRectangle ||
59 !overlap(R1->bounds, R2->bounds)
62 return CopyRegion(R2);
65 R3 = NewRegion();
67 if (R3)
71 _DoOperationBandBand
73 _ClearBandBand,
74 MinX(R1),
75 MinX(R2),
76 MinY(R1),
77 MinY(R2),
78 R1->RegionRectangle,
79 R2->RegionRectangle,
80 &R3->RegionRectangle,
81 &R3->bounds,
82 GfxBase
86 _TranslateRegionRectangles(R3->RegionRectangle, -MinX(R3), -MinY(R3));
88 else
90 DisposeRegion(R3);
91 R3 = NULL;
95 return R3;
97 AROS_LIBFUNC_EXIT