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

Function ReadColorMap

win/share/gifread.c:167–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167static boolean
168ReadColorMap(FILE *fd, int number)
169{
170 int i;
171 unsigned char rgb[3];
172
173 for (i = 0; i < number; ++i) {
174 if (!ReadOK(fd, rgb, sizeof(rgb))) {
175 return (FALSE);
176 }
177
178 ColorMap[CM_RED][i] = rgb[0];
179 ColorMap[CM_GREEN][i] = rgb[1];
180 ColorMap[CM_BLUE][i] = rgb[2];
181 }
182 colorsinmap = number;
183 return TRUE;
184}
185
186/*
187 * Read gif header, including colormaps. We expect only one image per

Callers 1

read_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected