169 |
|
} |
170 |
|
|
171 |
|
int num = (VidLocal.desc->mode.depth == VDEPTH_16BIT ? 32 : 256); |
172 |
– |
int inc = 256 / num, value = 0; |
172 |
|
uint8 *p = VidLocal.palette; |
173 |
|
for (int i=0; i<num; i++) { |
174 |
< |
uint8 red = value, green = value, blue = value; |
174 |
> |
uint8 red = (i * 256 / num), green = red, blue = red; |
175 |
|
if (have_gamma) { |
176 |
|
red = red_gamma[red >> (8 - data_width)]; |
177 |
|
green = green_gamma[green >> (8 - data_width)]; |
180 |
|
*p++ = red; |
181 |
|
*p++ = green; |
182 |
|
*p++ = blue; |
184 |
– |
value += inc; |
183 |
|
} |
184 |
|
|
185 |
|
video_set_palette(VidLocal.palette); |