Fixed a warning (missing type cast)
[tangerine.git] / rom / graphics / andrectrect.c
blob5294c1af90d9ee1845d1be3a4be54370f36e890d
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: (AROS only) Graphics function AndRectRect()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <graphics/regions.h>
11 #include <clib/macros.h>
12 #include "intregions.h"
14 /*****************************************************************************
16 NAME */
17 #include <clib/graphics_protos.h>
19 AROS_LH3(BOOL, AndRectRect,
21 /* SYNOPSIS */
22 AROS_LHA(struct Rectangle *, rect1, A0),
23 AROS_LHA(struct Rectangle *, rect2, A1),
24 AROS_LHA(struct Rectangle *, intersect, A2),
26 /* LOCATION */
27 struct GfxBase *, GfxBase, 193, Graphics)
29 /* FUNCTION
30 Calculate the intersection rectangle between the
31 given Rectangle rect1 and the given Rectangle rect2
32 leaving the result in intersect (if intersect != NULL).
34 INPUTS
35 rect1 - pointer to 1st Rectangle
36 rect2 - pointer to 2nd Rectangle
37 intersect -> pointer to rectangle which will hold result. May be NULL.
39 RESULT
40 TRUE if rect1 and rect2 do intersect. In this case intersect (unless NULL)
41 will contain the intersection rectangle.
43 FALSE if rect1 and rect2 do not overlap. "intersect" will
44 then be left unchanged.
46 NOTES
47 This function does not exist in AmigaOS.
49 EXAMPLE
51 BUGS
53 SEE ALSO
54 AndRectRegion() AndRegionRegion()
56 INTERNALS
58 HISTORY
59 15-12-2000 stegerg implemented
61 *****************************************************************************/
63 AROS_LIBFUNC_INIT
65 ASSERT_VALID_PTR(rect1);
66 ASSERT_VALID_PTR(rect2);
67 ASSERT_VALID_PTR_OR_NULL(intersect);
69 if (intersect)
70 return _AndRectRect(rect1, rect2, intersect);
71 else
72 return overlap(*rect1, *rect2);
74 AROS_LIBFUNC_EXIT
76 } /* AndRectRect */