Add missing 8bpp paletted texture conversions

This commit is contained in:
joseph 2016-12-27 22:55:02 -06:00 committed by Anthony Pesch
parent 3657d9f542
commit 19f93bb27d
2 changed files with 16 additions and 0 deletions

View File

@ -285,6 +285,8 @@ define_convert_pal4(RGB565, RGB565);
define_convert_pal4(ARGB4444, RGBA4444);
define_convert_pal4(ARGB8888, RGBA8888);
define_convert_pal8(ARGB1555, RGBA5551);
define_convert_pal8(RGB565, RGB565);
define_convert_pal8(ARGB4444, RGBA4444);
define_convert_pal8(ARGB8888, RGBA8888);

View File

@ -280,6 +280,20 @@ static texture_handle_t tr_demand_texture(struct tr *tr,
CHECK(!compressed);
output = converted;
switch (ctx->pal_pxl_format) {
case TA_PAL_ARGB1555:
pixel_fmt = PXL_RGBA5551;
convert_pal8_ARGB1555_RGBA5551(input, (uint16_t *)converted,
(const uint32_t *)palette, width,
height);
break;
case TA_PAL_RGB565:
pixel_fmt = PXL_RGB565;
convert_pal8_RGB565_RGB565(input, (uint16_t *)converted,
(const uint32_t *)palette, width,
height);
break;
case TA_PAL_ARGB4444:
pixel_fmt = PXL_RGBA4444;
convert_pal8_ARGB4444_RGBA4444(input, (uint16_t *)converted,