… | |
… | |
28 | |
28 | |
29 | faceidx blank_face, empty_face; |
29 | faceidx blank_face, empty_face; |
30 | |
30 | |
31 | facehash_t facehash; |
31 | facehash_t facehash; |
32 | std::vector<faceinfo> faces; |
32 | std::vector<faceinfo> faces; |
33 | |
|
|
34 | /* the only thing this table is used for now is to |
|
|
35 | * translate the colorname in the magicmap field of the |
|
|
36 | * face into a numeric index that is then sent to the |
|
|
37 | * client for magic map commands. The order of this table |
|
|
38 | * must match that of the NDI colors in include/newclient.h. |
|
|
39 | */ |
|
|
40 | static const char *const colorname[] = { |
|
|
41 | "black", /* 0 */ |
|
|
42 | "white", /* 1 */ |
|
|
43 | "blue", /* 2 */ |
|
|
44 | "red", /* 3 */ |
|
|
45 | "orange", /* 4 */ |
|
|
46 | "light_blue", /* 5 */ |
|
|
47 | "dark_orange", /* 6 */ |
|
|
48 | "green", /* 7 */ |
|
|
49 | "light_green", /* 8 */ |
|
|
50 | "grey", /* 9 */ |
|
|
51 | "brown", /* 10 */ |
|
|
52 | "yellow", /* 11 */ |
|
|
53 | "khaki" /* 12 */ |
|
|
54 | }; |
|
|
55 | |
|
|
56 | /* |
|
|
57 | * Returns the matching color in the coloralias if found, |
|
|
58 | * 0 otherwise. Note that 0 will actually be black, so there is no |
|
|
59 | * way the calling function can tell if an error occurred or not |
|
|
60 | */ |
|
|
61 | static uint8 |
|
|
62 | find_color (const char *name) |
|
|
63 | { |
|
|
64 | uint8 i; |
|
|
65 | |
|
|
66 | for (i = 0; i < sizeof (colorname) / sizeof (*colorname); i++) |
|
|
67 | if (!strcmp (name, colorname[i])) |
|
|
68 | return i; |
|
|
69 | |
|
|
70 | LOG (llevError, "Unknown color: %s\n", name); |
|
|
71 | return 0; |
|
|
72 | } |
|
|
73 | |
33 | |
74 | faceidx |
34 | faceidx |
75 | face_find (const char *name, faceidx defidx) |
35 | face_find (const char *name, faceidx defidx) |
76 | { |
36 | { |
77 | if (!name) |
37 | if (!name) |