Fixed RFX encoding.

This commit is contained in:
Armin Novak 2016-09-20 09:50:44 +02:00
parent 9ab04711fa
commit d55690db23
2 changed files with 123 additions and 97 deletions

View File

@ -192,7 +192,7 @@ static void rfx_decoder_tile_free(RFX_TILE* tile)
}
}
static RFX_TILE* rfx_encoder_tile_new()
static RFX_TILE* rfx_encoder_tile_new(void)
{
return (RFX_TILE*)calloc(1, sizeof(RFX_TILE));
}

View File

@ -61,6 +61,7 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height,
switch (pixel_format)
{
case PIXEL_FORMAT_BGRX32:
case PIXEL_FORMAT_BGRA32:
for (x = 0; x < width; x++)
{
@ -72,6 +73,19 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height,
break;
case PIXEL_FORMAT_XBGR32:
case PIXEL_FORMAT_ABGR32:
for (x = 0; x < width; x++)
{
src++;
*b_buf++ = (INT16)(*src++);
*g_buf++ = (INT16)(*src++);
*r_buf++ = (INT16)(*src++);
}
break;
case PIXEL_FORMAT_RGBX32:
case PIXEL_FORMAT_RGBA32:
for (x = 0; x < width; x++)
{
@ -83,6 +97,18 @@ static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height,
break;
case PIXEL_FORMAT_XRGB32:
case PIXEL_FORMAT_ARGB32:
for (x = 0; x < width; x++)
{
src++;
*r_buf++ = (INT16)(*src++);
*g_buf++ = (INT16)(*src++);
*b_buf++ = (INT16)(*src++);
}
break;
case PIXEL_FORMAT_BGR24:
for (x = 0; x < width; x++)
{