Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / graphics / andregionregionnd.c
blob9adcdeed990dd01b1cbe7140587549259918e737
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AndRegionRegion()
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_LH2(struct Region *, AndRegionRegionND,
19 /* SYNOPSIS */
20 AROS_LHA(struct Region *, R1, A0),
21 AROS_LHA(struct Region *, R2, A1),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 108, Graphics)
26 /* FUNCTION
27 AND of one region with another region
29 INPUTS
30 region1 - pointer to a region structure
31 region2 - pointer to a region structure
33 RESULT
34 The resulting region or NULL in case there's no enough free memory
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 XorRegionRegion(), OrRegionRegion()
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct Region *R3 = NewRegion();
57 R3 &&
58 R1->RegionRectangle &&
59 R2->RegionRectangle &&
60 overlap(R1->bounds, R2->bounds)
65 _DoOperationBandBand
67 _AndBandBand,
68 MinX(R1),
69 MinX(R2),
70 MinY(R1),
71 MinY(R2),
72 R1->RegionRectangle,
73 R2->RegionRectangle,
74 &R3->RegionRectangle,
75 &R3->bounds,
76 GfxBase
80 _TranslateRegionRectangles(R3->RegionRectangle, -MinX(R3), -MinY(R3));
82 else
84 DisposeRegion(R3);
85 R3 = NULL;
89 return R3;
91 AROS_LIBFUNC_EXIT