2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Graphics function WritePixel()
9 #include <graphics/rastport.h>
10 #include <graphics/clip.h>
11 #include <proto/graphics.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
16 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
17 WORD x
, WORD y
, struct GfxBase
*GfxBase
);
19 /*****************************************************************************
23 AROS_LH3(LONG
, WritePixel
,
26 AROS_LHA(struct RastPort
*, rp
, A1
),
27 AROS_LHA(WORD
, x
, D0
),
28 AROS_LHA(WORD
, y
, D1
),
31 struct GfxBase
*, GfxBase
, 54, Graphics
)
34 Write the primary (A) pen colour to the given coordinates of a
38 rp - destination RastPort
42 0: pixel could be written
43 -1: coordinate was outside rastport
54 This function takes layers into account. Some pixel that is
55 being read is not found on the display-bitmap but in some
56 clipped rectangle (cliprect) in a layer structure.
58 *****************************************************************************/
67 if ((rp
->Flags
& RPF_NO_PENS
) != 0)
70 pix
= BM_PIXEL(rp
->BitMap
, (UBYTE
)rp
->FgPen
);
72 return do_pixel_func(rp
, x
, y
, pix_write
, (APTR
)pix
, TRUE
, GfxBase
);
78 static LONG
pix_write(APTR pr_data
, OOP_Object
*bm
, OOP_Object
*gc
,
79 WORD x
, WORD y
, struct GfxBase
*GfxBase
)
81 HIDD_BM_PutPixel(bm
, x
, y
, (IPTR
)pr_data
);