r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / graphics / copyregion.c
blob961a44185871b04f25e4c370381d77f17e4e2743
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: (AROS only) Graphics function CopyRegion()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include "intregions.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/graphics.h>
17 AROS_LH1(struct Region *, CopyRegion,
19 /* SYNOPSIS */
20 AROS_LHA(struct Region *, region, A0),
22 /* LOCATION */
23 struct GfxBase *, GfxBase, 188, Graphics)
25 /* FUNCTION
26 Make a copy of the given Region.
28 INPUTS
29 region - pointer to a Region structure
31 RESULT
32 the copy of the Region, or NULL if not enough memory.
34 NOTES
35 This function does not exist in AmigaOS.
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 NewRegion() DisposeRegion()
44 INTERNALS
46 HISTORY
47 13-12-2000 stegerg implemented
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct Region *nreg;
55 if ((nreg = NewRegion()))
57 if (region->RegionRectangle)
59 struct RegionRectangle *new = NULL;
61 nreg->bounds = region->bounds;
63 if (!_LinkRegionRectangleList(region->RegionRectangle, &new, GfxBase))
65 DisposeRegion(nreg);
66 nreg = NULL;
69 nreg->RegionRectangle = &Chunk(new)->FirstChunk->Rects[0].RR;
73 return nreg;
75 AROS_LIBFUNC_EXIT
77 } /* CopyRegion */