summaryrefslogtreecommitdiff
path: root/jag_video.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-11-05 21:19:18 -0700
committerMichael Pavone <pavone@retrodev.com>2016-11-05 21:19:18 -0700
commit04bf2bb31d8c98f66b5f423fa28dc88a128fca12 (patch)
treec28f84bfcd2ac138657e91be31bf0606bbbe62f2 /jag_video.c
parent790388360b81d557a14e450898cbfd5c04b2654f (diff)
Fix CRY color mapping
Diffstat (limited to 'jag_video.c')
-rw-r--r--jag_video.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/jag_video.c b/jag_video.c
index 81dd5ed..bfb97bd 100644
--- a/jag_video.c
+++ b/jag_video.c
@@ -62,15 +62,15 @@ static uint32_t cry_to_rgb(uint16_t cry)
{
uint32_t y = cry & 0xFF;
if (y) {
- uint8_t c = cry >> 12;
- uint8_t r = cry >> 8 & 0xF;
+ uint8_t c = cry >> 8 & 0xF;
+ uint8_t r = cry >> 12;
uint32_t red = cry_red[c < 7 ? 0 : c - 7][r];
uint32_t green = cry_green[c][r < 8 ? r : 15 - r];
uint32_t blue = cry_red[c < 7 ? 0 : c - 7][15-r];
- red = red * 255 / y;
- blue = blue * 255 / y;
- green = green * 255 / y;
+ red = red * y / 255;
+ blue = blue * y / 255;
+ green = green * y / 255;
return render_map_color(red, green, blue);
} else {
return render_map_color(0, 0, 0);