Unification of "SEE ALSO" for boopsi.library
[cake.git] / rom / graphics / xorregionregionnd.c
blobdbe0773680822ef6f005fb35fafdd3de88a2abf7
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function XorRegionRegion()
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 *, XorRegionRegionND,
19 /* SYNOPSIS */
20 AROS_LHA(struct Region *, R1, A0),
21 AROS_LHA(struct Region *, R2, A1),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 151, Graphics)
26 /* FUNCTION
27 Exclusive-OR of one region with another region.
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
37 This function is not present in AmigaOS
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 AndRegionRegion(), OrRegionRegion()
46 INTERNALS
48 HISTORY
49 27-11-96 digulla automatically created from
50 graphics_lib.fd and clib/graphics_protos.h
51 19-01-97 mreckt intital version
53 22-09-2001 falemagn changed implementation
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
59 struct Region *R3;
63 !R1->RegionRectangle ||
64 !R2->RegionRectangle ||
65 !overlap(R1->bounds, R2->bounds)
68 return OrRegionRegionND(R1, R2);
71 R3 = NewRegion();
73 if (R3)
75 struct RegionRectangle *Diff1 = NULL;
76 struct RegionRectangle *Diff2 = NULL;
78 BOOL res =
79 _DoOperationBandBand
81 _ClearBandBand,
82 MinX(R1),
83 MinX(R2),
84 MinY(R1),
85 MinY(R2),
86 R1->RegionRectangle,
87 R2->RegionRectangle,
88 &Diff1,
89 &R3->bounds,
90 GfxBase
91 ) &&
92 _DoOperationBandBand
94 _ClearBandBand,
95 MinX(R2),
96 MinX(R1),
97 MinY(R2),
98 MinY(R1),
99 R2->RegionRectangle,
100 R1->RegionRectangle,
101 &Diff2,
102 &R3->bounds,
103 GfxBase
104 ) &&
105 _DoOperationBandBand
107 _OrBandBand,
112 Diff1,
113 Diff2,
114 &R3->RegionRectangle,
115 &R3->bounds,
116 GfxBase
119 _DisposeRegionRectangleList(Diff1, GfxBase);
120 _DisposeRegionRectangleList(Diff2, GfxBase);
122 if (res)
124 _TranslateRegionRectangles(R3->RegionRectangle, -MinX(R3), -MinY(R3));
126 else
128 DisposeRegion(R3);
129 R3 = NULL;
133 return R3;
135 AROS_LIBFUNC_EXIT