2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: (AROS only) Graphics function SetRegion()
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include "intregions.h"
12 /*****************************************************************************
15 #include <clib/graphics_protos.h>
17 AROS_LH2(BOOL
, SetRegion
,
20 AROS_LHA(struct Region
*, src
, A0
),
21 AROS_LHA(struct Region
*, dest
, A1
),
24 struct GfxBase
*, GfxBase
, 195, Graphics
)
27 Sets the destination region to the source region.
28 Allocates necessary RegionRectangles if necessary
29 and deallocates any excessive RegionRectangles in
30 the destination Region. The source Region remains
32 If the system runs out of memory during allocation
33 of RegionRectangles the destination Region will
39 TRUE if everything went alright, FALSE otherwise
49 NewRegion(), DisposeRegion(), CopyRegion()
55 *****************************************************************************/
59 struct RegionRectangle
* rrs
, *rrd
, *rrd_prev
, *addr
;
61 dest
->bounds
= src
->bounds
;
65 rrs
= src
->RegionRectangle
, rrd
= dest
->RegionRectangle
, rrd_prev
= NULL
;
67 rrd_prev
= rrd
, rrs
= rrs
->Next
, rrd
= rrd
->Next
70 rrd
->bounds
= rrs
->bounds
;
73 _DisposeRegionRectangleList(rrd
, GfxBase
);
79 dest
->RegionRectangle
= NULL
;
80 addr
= dest
->RegionRectangle
;
83 if (!_LinkRegionRectangleList(rrs
, &addr
, GfxBase
))
87 dest
->RegionRectangle
= addr
? &Chunk(addr
)->FirstChunk
->Rects
[0].RR
: NULL
;