2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: (AROS only) Graphics function SetRegion()
9 #include "graphics_intern.h"
10 #include <graphics/regions.h>
11 #include "intregions.h"
13 /*****************************************************************************
16 #include <clib/graphics_protos.h>
18 AROS_LH2(BOOL
, SetRegion
,
21 AROS_LHA(struct Region
*, src
, A0
),
22 AROS_LHA(struct Region
*, dest
, A1
),
25 struct GfxBase
*, GfxBase
, 181, Graphics
)
28 Sets the destination region to the source region.
29 Allocates necessary RegionRectangles if necessary
30 and deallocates any excessive RegionRectangles in
31 the destination Region. The source Region remains
33 If the system runs out of memory during allocation
34 of RegionRectangles the destination Region will
40 TRUE if everything went alright, FALSE otherwise
50 NewRegion(), DisposeRegion()
56 *****************************************************************************/
60 struct RegionRectangle
* rrs
, *rrd
, *rrd_prev
, *addr
;
62 dest
->bounds
= src
->bounds
;
66 rrs
= src
->RegionRectangle
, rrd
= dest
->RegionRectangle
, rrd_prev
= NULL
;
68 rrd_prev
= rrd
, rrs
= rrs
->Next
, rrd
= rrd
->Next
71 rrd
->bounds
= rrs
->bounds
;
74 _DisposeRegionRectangleList(rrd
, GfxBase
);
80 dest
->RegionRectangle
= NULL
;
81 addr
= dest
->RegionRectangle
;
84 if (!_LinkRegionRectangleList(rrs
, &addr
, GfxBase
))
88 dest
->RegionRectangle
= addr
? &Chunk(addr
)->FirstChunk
->Rects
[0].RR
: NULL
;