MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_colors

Function get_colors

outdated/win/gem/load_img.c:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24int vdi2dev2[] = { 0, 3, 1, 2 };
25
26void
27get_colors(int handle, short *palette, int col)
28{
29 int i, idx;
30
31 /* get current color palette */
32 for (i = 0; i < col; i++) {
33 /* device->vdi->device palette order */
34 switch (planes) {
35 case 1:
36 idx = i;
37 break;
38 case 2:
39 idx = vdi2dev2[i];
40 break;
41 case 4:
42 idx = vdi2dev4[i];
43 break;
44 default:
45 if (i < 16)
46 idx = vdi2dev4[i];
47 else
48 idx = i == 255 ? 1 : i;
49 }
50 vq_color(handle, i, 0, (int *) palette + idx * 3);
51 }
52}
53
54void
55img_set_colors(int handle, short *palette, int col)

Callers 1

mar_gem_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected