Nonsense removed: upper case and lower case the same time.
[AROS.git] / rom / graphics / drawellipse.c
blobedb25d40ff162c9b7b6b6990fd98a3af4ec843b0
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$ $Log
5 Desc: Graphics function DrawEllipse
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <clib/macros.h>
10 #include "graphics_intern.h"
11 #include <graphics/rastport.h>
12 #include "gfxfuncsupport.h"
13 #include "intregions.h"
15 struct ellipse_render_data
17 struct render_special_info rsi;
18 LONG a, b;
21 static ULONG ellipse_render(APTR ellipse_rd, LONG srcx, LONG srcy,
22 OOP_Object *dstbm_obj, OOP_Object *dst_gc,
23 LONG x1, LONG y1, LONG x2, LONG y2, struct GfxBase *GfxBase);
25 /*****************************************************************************
27 NAME */
28 #include <graphics/rastport.h>
29 #include <proto/graphics.h>
31 AROS_LH5(void, DrawEllipse,
33 /* SYNOPSIS */
34 AROS_LHA(struct RastPort *, rp, A1),
35 AROS_LHA(LONG , xCenter, D0),
36 AROS_LHA(LONG , yCenter, D1),
37 AROS_LHA(LONG , a, D2),
38 AROS_LHA(LONG , b, D3),
40 /* LOCATION */
41 struct GfxBase *, GfxBase, 30, Graphics)
43 /* FUNCTION
44 Draw an ellipse
46 INPUTS
47 rp - destination RastPort
48 xCenter,yCenter - coordinate of centerpoint
49 a - radius in x direction
50 b - radius in y direction
52 RESULT
54 NOTES
56 EXAMPLE
58 BUGS
60 SEE ALSO
62 INTERNALS
64 HISTORY
65 29-10-95 digulla automatically created from
66 graphics_lib.fd and clib/graphics_protos.h
68 *****************************************************************************/
70 AROS_LIBFUNC_INIT
72 struct Rectangle rr;
73 struct ellipse_render_data erd;
74 OOP_Object *gc;
76 if (!OBTAIN_DRIVERDATA(rp, GfxBase))
77 return;
79 FIX_GFXCOORD(xCenter);
80 FIX_GFXCOORD(yCenter);
81 FIX_GFXCOORD(a);
82 FIX_GFXCOORD(b);
84 /* bug("driver_DrawEllipse(%d %d %d %d)\n", xCenter, yCenter, a, b);
85 */ gc = GetDriverData(rp)->dd_GC;
87 rr.MinX = xCenter - a;
88 rr.MinY = yCenter - b;
89 rr.MaxX = xCenter + a;
90 rr.MaxY = yCenter + b;
92 erd.a = a;
93 erd.b = b;
95 do_render_func(rp, NULL, &rr, ellipse_render, &erd, TRUE, TRUE, GfxBase);
97 RELEASE_DRIVERDATA(rp, GfxBase);
99 AROS_LIBFUNC_EXIT
101 } /* DrawEllipse */
103 /****************************************************************************************/
105 static ULONG ellipse_render(APTR ellipse_rd, LONG srcx, LONG srcy,
106 OOP_Object *dstbm_obj, OOP_Object *dst_gc,
107 LONG x1, LONG y1, LONG x2, LONG y2, struct GfxBase *GfxBase)
109 struct ellipse_render_data *erd;
111 erd = (struct ellipse_render_data *)ellipse_rd;
113 HIDD_GC_SetClipRect(dst_gc, x1, y1, x2, y2);
115 HIDD_BM_DrawEllipse(dstbm_obj, dst_gc, erd->a + x1 - srcx, erd->b + y1 - srcy,
116 erd->a, erd->b);
118 HIDD_GC_UnsetClipRect(dst_gc);
120 return 0;
123 /****************************************************************************************/