2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function SetABPenDrMd()
8 #include "graphics_intern.h"
10 #include "gfxfuncsupport.h"
12 /*****************************************************************************
15 #include <graphics/rastport.h>
16 #include <proto/graphics.h>
18 AROS_LH4(void, SetABPenDrMd
,
21 AROS_LHA(struct RastPort
*, rp
, A1
),
22 AROS_LHA(ULONG
, apen
, D0
),
23 AROS_LHA(ULONG
, bpen
, D1
),
24 AROS_LHA(ULONG
, drawMode
, D2
),
27 struct GfxBase
*, GfxBase
, 149, Graphics
)
30 Changes the foreground and background pen and the drawmode in one
34 rp - Modify this RastPort
35 apen - The new foreground pen
36 bpen - The new background pen
37 drawmode - The new drawmode
43 This function is faster than the sequence SetAPen(), SetBPen(),
55 29-10-95 digulla automatically created from
56 graphics_lib.fd and clib/graphics_protos.h
58 *****************************************************************************/
62 struct gfx_driverdata
*dd
;
64 if (OBTAIN_DRIVERDATA(rp
, GfxBase
))
67 dd
= GetDriverData(rp
);
70 struct TagItem gc_tags
[] =
72 { aHidd_GC_Foreground
, 0 },
73 { aHidd_GC_Background
, 0 },
74 { aHidd_GC_ColorExpansionMode
, 0UL },
75 { aHidd_GC_DrawMode
, vHidd_GC_DrawMode_Copy
},
79 gc_tags
[0].ti_Data
= rp
->BitMap
? BM_PIXEL(rp
->BitMap
, apen
& PEN_MASK
) : apen
;
80 gc_tags
[1].ti_Data
= rp
->BitMap
? BM_PIXEL(rp
->BitMap
, bpen
& PEN_MASK
) : bpen
;
84 gc_tags
[2].ti_Data
= vHidd_GC_ColExp_Opaque
;
86 else if (drawMode
& COMPLEMENT
)
88 gc_tags
[3].ti_Data
= vHidd_GC_DrawMode_Invert
;
90 else if ((drawMode
& (~INVERSVID
)) == JAM1
)
92 gc_tags
[2].ti_Data
= vHidd_GC_ColExp_Transparent
;
95 OOP_SetAttrs(dd
->dd_GC
, gc_tags
);
99 RELEASE_DRIVERDATA(rp
, GfxBase
);
101 } /* if (OBTAIN_DRIVERDATA(rp, GfxBase)) */
103 /* Do it after the driver to allow it to inspect the previous value */
106 rp
->DrawMode
= drawMode
;