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

Function read_text_colormap

win/share/tiletext.c:127–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127static void
128read_text_colormap(FILE *txtfile)
129{
130 int i, r, g, b;
131 char c[2];
132
133 for (i = 0; i < MAXCOLORMAPSIZE; i++)
134 color_index[i] = -1;
135
136 num_colors = 0;
137 while (get_next_line(txtfile, TRUE)) {
138 if (sscanf(inbuf, FORMAT_STRING, c, &r, &g, &b) != 4)
139 break;
140 color_index[(int) c[0]] = num_colors;
141 ColorMap[CM_RED][num_colors] = r;
142 ColorMap[CM_GREEN][num_colors] = g;
143 ColorMap[CM_BLUE][num_colors] = b;
144 num_colors++;
145 }
146 colorsinmap = num_colors;
147}
148
149#undef FORMAT_STRING
150

Callers 1

fopen_text_fileFunction · 0.85

Calls 1

get_next_lineFunction · 0.85

Tested by

no test coverage detected