diff options
Diffstat (limited to 'hw/tcx.c')
-rw-r--r-- | hw/tcx.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -58,13 +58,22 @@ static void update_palette_entries(TCXState *s, int start, int end) s->palette[i] = rgb_to_pixel8(s->r[i], s->g[i], s->b[i]); break; case 15: - s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]); + if (s->ds->bgr) + s->palette[i] = rgb_to_pixel15bgr(s->r[i], s->g[i], s->b[i]); + else + s->palette[i] = rgb_to_pixel15(s->r[i], s->g[i], s->b[i]); break; case 16: - s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]); + if (s->ds->bgr) + s->palette[i] = rgb_to_pixel16bgr(s->r[i], s->g[i], s->b[i]); + else + s->palette[i] = rgb_to_pixel16(s->r[i], s->g[i], s->b[i]); break; case 32: - s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); + if (s->ds->bgr) + s->palette[i] = rgb_to_pixel32bgr(s->r[i], s->g[i], s->b[i]); + else + s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); break; } } |