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

Function write_text_colormap

win/share/tiletext.c:151–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149#undef FORMAT_STRING
150
151static boolean
152write_text_colormap(FILE *txtfile)
153{
154 int i;
155 char c;
156
157 num_colors = colorsinmainmap;
158 if (num_colors > 62) {
159 Fprintf(stderr, "too many colors (%d)\n", num_colors);
160 return FALSE;
161 }
162 for (i = 0; i < num_colors; i++) {
163 if (i < 26)
164 c = 'A' + i;
165 else if (i < 52)
166 c = 'a' + i - 26;
167 else
168 c = '0' + i - 52;
169
170 charcolors[i] = c;
171 Fprintf(
172 txtfile, "%c = (%d, %d, %d)\n", c, (int) MainColorMap[CM_RED][i],
173 (int) MainColorMap[CM_GREEN][i], (int) MainColorMap[CM_BLUE][i]);
174 }
175 return TRUE;
176}
177
178/* read one tile from win/share/{monsters,objects,other}.txt */
179static boolean

Callers 1

fopen_text_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected