2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Graphics function OrRectRegion()
9 #include <exec/memory.h>
10 #include <graphics/regions.h>
11 #include <proto/exec.h>
13 #include "graphics_intern.h"
14 #include "intregions.h"
16 /*****************************************************************************
19 #include <proto/graphics.h>
21 AROS_LH2(BOOL
, OrRectRegion
,
24 AROS_LHA(struct Region
*, Reg
, A0
),
25 AROS_LHA(struct Rectangle
*, Rect
, A1
),
28 struct GfxBase
*, GfxBase
, 85, Graphics
)
31 Add the given Rectangle to the given Region (if not
35 region - pointer to Region structure
36 rectangle - pointer to Rectangle structure
39 TRUE if the operation was successful, else FALSE
43 All relevant data is copied, you may throw away the
44 given rectangle after calling this function
51 AndRectRegion(), XorRectRegion(), ClearRectRegion()
56 27-11-96 digulla automatically created from
57 graphics_lib.fd and clib/graphics_protos.h
58 16-01-97 mreckt initial version
60 *****************************************************************************/
64 if (IS_RECT_EVIL(Rect
)) return TRUE
;
66 if (Reg
->RegionRectangle
)
68 /* Region is not empty. Do the complete algorithm. */
70 struct RegionRectangle rr
;
78 if (_DoOperationBandBand(_OrBandBand
,
79 MinX(Reg
), 0, MinY(Reg
), 0,
80 Reg
->RegionRectangle
, &rr
, &Res
.RegionRectangle
, &Res
.bounds
, GfxBase
))
85 _TranslateRegionRectangles(Res
.RegionRectangle
, -MinX(&Res
), -MinY(&Res
));
92 /* Optimized version for empty destination Region. Just add a single rectangle. */
93 struct RegionRectangle
*rr
= _NewRegionRectangle(&Reg
->RegionRectangle
, GfxBase
);
101 rr
->bounds
.MaxX
= Rect
->MaxX
- Rect
->MinX
;
102 rr
->bounds
.MaxY
= Rect
->MaxY
- Rect
->MinY
;