r4493@vps: verhaegs | 2007-04-19 14:44:00 -0400
[AROS.git] / rom / graphics / areadraw.c
blob9468ad215949eff233d0383b1efa30b6c23e6c8a
1 /*
2 Copyright © 1995-2001, 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() graphics/rastport.h
50 INTERNALS
52 HISTORY
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
57 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
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 */