2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: Graphics function SetRGB4CM()
8 #include <graphics/view.h>
9 #include "graphics_intern.h"
11 /*****************************************************************************
14 #include <proto/graphics.h>
16 AROS_LH5(void, SetRGB4CM
,
19 AROS_LHA(struct ColorMap
*, cm
, A0
),
20 AROS_LHA(WORD
, n
, D0
),
21 AROS_LHA(UBYTE
, r
, D1
),
22 AROS_LHA(UBYTE
, g
, D2
),
23 AROS_LHA(UBYTE
, b
, D3
),
26 struct GfxBase
*, GfxBase
, 105, Graphics
)
29 Set one color in the ColorMap.
32 cm - ColorMap structure obtained via GetColorMap()
33 n - the number of the color register to set
35 g - green level (0-15)
39 Store the (r,g,b) triplet at index n in the ColorMap structure.
40 The changes will not be immediately displayed. Use this function
41 before linking the ColorMap to a ViewPort.
50 GetColorMap(), SetRGB4(), GetRGB4(), graphics/view.h
53 This function depends on the ColorMap->ColorTable structure
57 *****************************************************************************/
61 if (NULL
!= cm
&& n
< cm
->Count
)
63 /* Preserve the highest nibble. Needed for interoperability
64 with m68k graphics.library. Exact purpose is currently
66 UWORD a
= ((UWORD
*)cm
->ColorTable
)[n
] & 0xF000;
68 ((UWORD
*)cm
->ColorTable
)[n
] = a
| (r
<< 16) | (g
<< 8) | b
;
70 if (cm
->Type
> COLORMAP_TYPE_V1_2
)
71 ((UWORD
*)cm
->LowColorBits
)[n
] = 0;