2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function DrawEllipse
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
;
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 /*****************************************************************************
28 #include <graphics/rastport.h>
29 #include <proto/graphics.h>
31 AROS_LH5(void, DrawEllipse
,
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
),
41 struct GfxBase
*, GfxBase
, 30, Graphics
)
47 rp - destination RastPort
48 xCenter,yCenter - coordinate of centerpoint
49 a - radius in x direction
50 b - radius in y direction
65 29-10-95 digulla automatically created from
66 graphics_lib.fd and clib/graphics_protos.h
68 *****************************************************************************/
73 struct ellipse_render_data erd
;
76 if (!OBTAIN_DRIVERDATA(rp
, GfxBase
))
79 FIX_GFXCOORD(xCenter
);
80 FIX_GFXCOORD(yCenter
);
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
;
95 do_render_func(rp
, NULL
, &rr
, ellipse_render
, &erd
, TRUE
, TRUE
, GfxBase
);
97 RELEASE_DRIVERDATA(rp
, GfxBase
);
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
,
118 HIDD_GC_UnsetClipRect(dst_gc
);
123 /****************************************************************************************/