Added basic implementation of destroying a GPT table: just delete the
[AROS.git] / rom / graphics / loadrgb32.c
blob0c80eca676aeb28674f80f03a7b99be08720686f
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #define DEBUG 0
10 #include <aros/debug.h>
11 #include "graphics_intern.h"
12 #include <proto/graphics.h>
14 /*****************************************************************************
16 NAME */
18 AROS_LH2(void, LoadRGB32,
20 /* SYNOPSIS */
21 AROS_LHA(struct ViewPort *, vp, A0),
22 AROS_LHA(const ULONG *, table, A1),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 147, Graphics)
27 /* FUNCTION
28 Load RGB color values from table.
30 INPUTS
31 vp - ViewPort
32 table - pointer to table of records
33 1 Word with the number of colors to load
34 1 Word with the first color to be loaded.
35 3 Longwords representing a left justified 32 bit RGB triplet.
36 The list is terminated by a count value of 0.
37 RESULT
39 NOTES
41 EXAMPLE
42 ULONG table[] = { 1l << 16 + 0 , 0xffffffff , 0 , 0 , 0}
43 ULONG table[] = { 256l << 16 + 0 , r1 , g1 , b1 , r2 , g2 , b2 , ..... 0}
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
52 27-11-96 digulla automatically created from
53 graphics_lib.fd and clib/graphics_protos.h
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
59 ASSERT_VALID_PTR(vp);
60 ASSERT_VALID_PTR_OR_NULL(table);
62 /* it is legal to pass a NULL table */
64 D(bug("LoadRGB32(0x%p)\n", vp));
65 if (table)
67 ULONG count;
69 /* table is terminated by a count value of 0 */
71 while ((count = (*table) >> 16))
73 ULONG first, t;
75 first = (*table) & 0xFFFF;
77 table ++;
79 D(bug("[LoadRGB32] Setting %u colors starting from %u\n", count, first));
80 for (t = 0; t < count; t++)
82 D(bug("[LoadRGB32] Color %u R 0x%08lX G 0x%08lX B %08lX\n", t + first, table[0], table[1], table[2]));
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 */