2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Graphics function DrawEllipse
9 #include <aros/debug.h>
10 #include <clib/macros.h>
11 #include <graphics/rastport.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
15 #include "intregions.h"
17 /****************************************************************************************/
19 struct ellipse_render_data
21 struct render_special_info rsi
;
25 static ULONG
ellipse_render(APTR ellipse_rd
, WORD srcx
, WORD srcy
,
26 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
27 struct Rectangle
*rect
, struct GfxBase
*GfxBase
)
29 struct ellipse_render_data
*erd
= ellipse_rd
;
32 * This is a quick way to install ClipRect on a GC. Just set one pointer.
33 * This is why we have a struct Rectangle * in the GC.
35 GC_DOCLIP(dst_gc
) = rect
;
37 HIDD_BM_DrawEllipse(dstbm_obj
, dst_gc
, erd
->a
+ rect
->MinX
- srcx
, erd
->b
+ rect
->MinY
- srcy
,
41 * After we exit this routine, 'rect' will be not valid any more.
42 * So do not forget to reset the pointer!
44 GC_DOCLIP(dst_gc
) = NULL
;
49 /*****************************************************************************
52 #include <graphics/rastport.h>
53 #include <proto/graphics.h>
55 AROS_LH5(void, DrawEllipse
,
58 AROS_LHA(struct RastPort
*, rp
, A1
),
59 AROS_LHA(WORD
, xCenter
, D0
),
60 AROS_LHA(WORD
, yCenter
, D1
),
61 AROS_LHA(WORD
, a
, D2
),
62 AROS_LHA(WORD
, b
, D3
),
65 struct GfxBase
*, GfxBase
, 30, Graphics
)
71 rp - destination RastPort
72 xCenter,yCenter - coordinate of centerpoint
73 a - radius in x direction
74 b - radius in y direction
89 29-10-95 digulla automatically created from
90 graphics_lib.fd and clib/graphics_protos.h
92 *****************************************************************************/
97 struct ellipse_render_data erd
;
99 FIX_GFXCOORD(xCenter
);
100 FIX_GFXCOORD(yCenter
);
104 /* bug("driver_DrawEllipse(%d %d %d %d)\n", xCenter, yCenter, a, b);
106 rr
.MinX
= xCenter
- a
;
107 rr
.MinY
= yCenter
- b
;
108 rr
.MaxX
= xCenter
+ a
;
109 rr
.MaxY
= yCenter
+ b
;
114 do_render_func(rp
, NULL
, &rr
, ellipse_render
, &erd
, TRUE
, TRUE
, GfxBase
);