Some fixes.
[cake.git] / rom / graphics / orrectregionnd.c
blob71c397c3a040a5090023288ad0cbc267f3d0e546
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AndRectRegion()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include <proto/exec.h>
11 #include <clib/macros.h>
12 #include "intregions.h"
14 /*****************************************************************************
16 NAME */
17 #include <proto/graphics.h>
19 AROS_LH2(struct Region *, OrRectRegionND,
21 /* SYNOPSIS */
22 AROS_LHA(struct Region *, Reg, A0),
23 AROS_LHA(struct Rectangle *, Rect, A1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 123, Graphics)
28 /* FUNCTION
29 Add the given Rectangle to the given Region (if not
30 already there)
32 INPUTS
33 region - pointer to Region structure
34 rectangle - pointer to Rectangle structure
36 RESULT
37 The resulting region or NULL in case there's no enough free memory
39 NOTES
41 BUGS
43 SEE ALSO
44 AndRegionRegion(), OrRectRegion(), XorRectRegion(), ClearRectRegion()
45 NewRegion()
47 INTERNALS
49 HISTORY
50 27-11-96 digulla automatically created from
51 graphics_lib.fd and clib/graphics_protos.h
52 16-01-97 mreckt initial version
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct Region *Res = NewRegion();
60 if (Res)
63 struct RegionRectangle rr;
65 rr.bounds = *Rect;
66 rr.Next = NULL;
67 rr.Prev = NULL;
71 _DoOperationBandBand
73 _OrBandBand,
74 MinX(Reg),
76 MinY(Reg),
78 Reg->RegionRectangle,
79 &rr,
80 &Res->RegionRectangle,
81 &Res->bounds,
82 GfxBase
87 _TranslateRegionRectangles(Res->RegionRectangle, -MinX(Res), -MinY(Res));
89 return Res;
92 DisposeRegion(Res);
95 return NULL;
97 AROS_LIBFUNC_EXIT
98 } /* AndRectRegion */