2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Graphics function AndRectRegion()
9 #include "graphics_intern.h"
10 #include <graphics/regions.h>
11 #include <proto/exec.h>
12 #include <clib/macros.h>
13 #include "intregions.h"
15 /*****************************************************************************
18 #include <proto/graphics.h>
20 AROS_LH2(struct Region
*, OrRectRegionND
,
23 AROS_LHA(struct Region
*, Reg
, A0
),
24 AROS_LHA(struct Rectangle
*, Rect
, A1
),
27 struct GfxBase
*, GfxBase
, 188, Graphics
)
30 Add the given Rectangle to the given Region (if not
34 region - pointer to Region structure
35 rectangle - pointer to Rectangle structure
38 The resulting region or NULL in case there's no enough free memory
45 AndRegionRegion(), OrRectRegion(), XorRectRegion(), ClearRectRegion()
51 27-11-96 digulla automatically created from
52 graphics_lib.fd and clib/graphics_protos.h
53 16-01-97 mreckt initial version
55 *****************************************************************************/
59 struct Region
*Res
= NewRegion();
63 if (IS_RECT_EVIL(Rect
))
65 /* Source Rect is empty. Make a plain copy of Reg. */
66 if (_CopyRegionRectangles(Reg
, Res
, GfxBase
))
71 struct RegionRectangle rr
;
77 if (_DoOperationBandBand(_OrBandBand
,
78 MinX(Reg
), 0, MinY(Reg
), 0,
79 Reg
->RegionRectangle
, &rr
, &Res
->RegionRectangle
, &Res
->bounds
, GfxBase
))
81 _TranslateRegionRectangles(Res
->RegionRectangle
, -MinX(Res
), -MinY(Res
));