aboutsummaryrefslogtreecommitdiffstats
path: root/fb-gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'fb-gui.c')
-rw-r--r--fb-gui.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fb-gui.c b/fb-gui.c
index be2eeb8..67a3412 100644
--- a/fb-gui.c
+++ b/fb-gui.c
@@ -47,14 +47,19 @@ linear_palette(int r, int g, int b)
size = 256 >> (8 - r);
for (i = 0; i < size; i++)
p_red[i] = calc_gamma(i,size);
+ p_cmap.len = size;
size = 256 >> (8 - g);
for (i = 0; i < size; i++)
p_green[i] = calc_gamma(i,size);
+ if (p_cmap.len < size)
+ p_cmap.len = size;
size = 256 >> (8 - b);
for (i = 0; i < size; i++)
p_blue[i] = calc_gamma(i,size);
+ if (p_cmap.len < size)
+ p_cmap.len = size;
}
static void
@@ -70,6 +75,7 @@ dither_palette(int r, int g, int b)
p_green[i] = calc_gamma(gs * ((i / b) % g), 255);
p_blue[i] = calc_gamma(bs * ((i) % b), 255);
}
+ p_cmap.len = 256;
}
static void shadow_lut_init_one(int32_t *lut, int bits, int shift)