| 125 | } |
| 126 | |
| 127 | static void |
| 128 | read_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 |
no test coverage detected