Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / graphics / orrectregionnd.c
blobbed86c23e546342fd6b2a553d875682ace33a4e3
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 (IS_RECT_EVIL(Rect))
62 return CopyRegion(Reg);
65 if (Res)
68 struct RegionRectangle rr;
70 rr.bounds = *Rect;
71 rr.Next = NULL;
72 rr.Prev = NULL;
76 _DoOperationBandBand
78 _OrBandBand,
79 MinX(Reg),
81 MinY(Reg),
83 Reg->RegionRectangle,
84 &rr,
85 &Res->RegionRectangle,
86 &Res->bounds,
87 GfxBase
92 _TranslateRegionRectangles(Res->RegionRectangle, -MinX(Res), -MinY(Res));
94 return Res;
97 DisposeRegion(Res);
100 return NULL;
102 AROS_LIBFUNC_EXIT
103 } /* AndRectRegion */