codeset
[AROS.git] / rom / graphics / cgx_support.c
blobc4c62b428bf72fe11ca09917e2b7058458f9a3d4
1 #include <graphics/renderfunc.h>
3 #include "graphics_intern.h"
4 #include "gfxfuncsupport.h"
6 /* Private lowlevel functions needed by cybergraphics.library */
8 AROS_LH9(LONG, WritePixels8,
9 AROS_LHA(struct RastPort, *rp, A0),
10 AROS_LHA(UBYTE, *array, A1),
11 AROS_LHA(ULONG, modulo, D0),
12 AROS_LHA(LONG, xstart, D1),
13 AROS_LHA(LONG, ystart, D2),
14 AROS_LHA(LONG, xstop, D3),
15 AROS_LHA(LONG, ystop, D4),
16 AROS_LHA(HIDDT_PixelLUT *, pixlut, A2),
17 AROS_LHA(BOOL, do_update, D5),
18 struct GfxBase *, GfxBase, 182, Graphics)
20 AROS_LIBFUNC_INIT
22 return write_pixels_8(rp, array, modulo, xstart, ystart, xstop, ystop, pixlut, do_update, GfxBase);
24 AROS_LIBFUNC_EXIT
27 AROS_LH8(LONG, FillRectPenDrMd,
28 AROS_LHA(struct RastPort, *rp, A0),
29 AROS_LHA(LONG, x1, D0),
30 AROS_LHA(LONG, y1, D1),
31 AROS_LHA(LONG, x2, D2),
32 AROS_LHA(LONG, y2, D3),
33 AROS_LHA(HIDDT_Pixel, pix, D4),
34 AROS_LHA(HIDDT_DrawMode, drmd, D5),
35 AROS_LHA(BOOL, do_update, D6),
36 struct GfxBase *, GfxBase, 183, Graphics)
38 AROS_LIBFUNC_INIT
40 return fillrect_pendrmd(rp, x1, y1, x2, y2, pix, drmd, do_update, GfxBase);
42 AROS_LIBFUNC_EXIT
45 AROS_LH6(ULONG, DoRenderFunc,
46 AROS_LHA(struct RastPort, *rp, A0),
47 AROS_LHA(Point, *src, A1),
48 AROS_LHA(struct Rectangle, *rr, A2),
49 AROS_LHA(RENDERFUNC, render_func, A3),
50 AROS_LHA(APTR, funcdata, A4),
51 AROS_LHA(BOOL, do_update, D0),
52 struct GfxBase *, GfxBase, 184, Graphics)
54 AROS_LIBFUNC_INIT
56 ULONG res;
58 if (!OBTAIN_DRIVERDATA(rp, GfxBase))
59 return -1;
61 res = do_render_func(rp, src, rr, render_func, funcdata, do_update, FALSE, GfxBase);
63 RELEASE_DRIVERDATA(rp, GfxBase);
64 return res;
66 AROS_LIBFUNC_EXIT
69 AROS_LH6(LONG, DoPixelFunc,
70 AROS_LHA(struct RastPort, *rp, A0),
71 AROS_LHA(LONG, x, D0),
72 AROS_LHA(LONG, y, D1),
73 AROS_LHA(PIXELFUNC, render_func, A1),
74 AROS_LHA(APTR, funcdata, A2),
75 AROS_LHA(BOOL, do_update, D2),
76 struct GfxBase *, GfxBase, 185, Graphics)
78 AROS_LIBFUNC_INIT
80 LONG res;
82 if (!OBTAIN_DRIVERDATA(rp, GfxBase))
83 return -1;
85 res = do_pixel_func(rp, x, y, render_func, funcdata, do_update, GfxBase);
87 RELEASE_DRIVERDATA(rp, GfxBase);
88 return res;
90 AROS_LIBFUNC_EXIT