define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / rom / graphics / loadrgb32.c
blob1ecd805115933f0c5ded8b1ee46e306a57d5c7d1
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <proto/graphics.h>
12 #if DEBUG
13 #undef THIS_FILE
14 static const char THIS_FILE[] = __FILE__;
15 #endif
17 /*****************************************************************************
19 NAME */
21 AROS_LH2(void, LoadRGB32,
23 /* SYNOPSIS */
24 AROS_LHA(struct ViewPort *, vp, A0),
25 AROS_LHA(const ULONG *, table, A1),
27 /* LOCATION */
28 struct GfxBase *, GfxBase, 147, Graphics)
30 /* FUNCTION
31 Load RGB color values from table.
33 INPUTS
34 vp - ViewPort
35 table - pointer to table of records
36 1 Word with the number of colors to load
37 1 Word with the first color to be loaded.
38 3 Longwords representing a left justified 32 bit RGB triplet.
39 The list is terminated by a count value of 0.
40 RESULT
42 NOTES
44 EXAMPLE
45 ULONG table[] = { 1l << 16 + 0 , 0xffffffff , 0 , 0 , 0}
46 ULONG table[] = { 256l << 16 + 0 , r1 , g1 , b1 , r2 , g2 , b2 , ..... 0}
48 BUGS
50 SEE ALSO
52 INTERNALS
54 HISTORY
55 27-11-96 digulla automatically created from
56 graphics_lib.fd and clib/graphics_protos.h
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
62 ASSERT_VALID_PTR(vp);
63 ASSERT_VALID_PTR_OR_NULL(table);
65 /* it is legal to pass a NULL table */
67 if (table)
69 ULONG count;
71 /* table is terminated by a count value of 0 */
73 while ((count = (*table) >> 16))
75 ULONG first, t;
77 first = (*table) & 0xFFFF;
79 table ++;
81 for (t = 0; t < count; t++)
83 SetRGB32 (vp,
84 t + first,
85 table[0],
86 table[1],
87 table[2]);
89 table += 3;
92 } /* while (*table) */
95 AROS_LIBFUNC_EXIT
97 } /* LoadRGB32 */