grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / areadraw.c
blobf42251e8d067aa588950c20867fff4bc556f1f14
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AreaDraw()
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
11 #include "gfxfuncsupport.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/graphics.h>
18 AROS_LH3(ULONG, AreaDraw,
20 /* SYNOPSIS */
21 AROS_LHA(struct RastPort *, rp, A1),
22 AROS_LHA(WORD , x , D0),
23 AROS_LHA(WORD , y , D1),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 43, Graphics)
28 /* FUNCTION
29 Add a point to the vector buffer.
31 INPUTS
32 rp - pointer to a valid RastPort structure with a pointer to
33 the previously initialized AreaInfo structure.
34 x - x-coordinate of the point in the raster
35 y - y-coordinate of the point in the raster
37 RESULT
38 error - 0 for success
39 -1 if the vector collection matrix is full
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 InitArea(), AreaMove(), AreaEllipse(), AreaCircle()
49 graphics/rastport.h
51 INTERNALS
53 HISTORY
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
59 struct AreaInfo * areainfo = rp->AreaInfo;
61 /* Is there still enough storage area in the areainfo-buffer?
62 * We only need on vector to store here.
65 if (areainfo->Count + 1 <= areainfo->MaxCount)
67 FIX_GFXCOORD(x);
68 FIX_GFXCOORD(y);
70 /* increment counter */
72 areainfo->Count++;
73 areainfo->VctrPtr[0] = x;
74 areainfo->VctrPtr[1] = y;
75 areainfo->FlagPtr[0] = AREAINFOFLAG_DRAW;
77 areainfo->VctrPtr = &areainfo->VctrPtr[2];
78 areainfo->FlagPtr++;
80 return 0;
83 return -1;
85 AROS_LIBFUNC_EXIT
87 } /* AreaDraw */