Merge pull request #7889 from jdgleaver/rgui-colours-psp-gekko

(RGUI) Fix colours for PSP and GEKKO builds
This commit is contained in:
Twinaphex 2019-01-04 18:30:32 +01:00 committed by GitHub
commit deb5c9b03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,19 @@ static uint16_t argb32_to_abgr1555(uint32_t col)
#define argb32_to_pixel_platform_format(color) argb32_to_abgr1555(color)
#elif defined(PSP) || defined(GEKKO)
static uint16_t argb32_to_abgr4444(uint32_t col)
{
unsigned a = ((col >> 24) & 0xff) >> 4;
unsigned r = ((col >> 16) & 0xff) >> 4;
unsigned g = ((col >> 8) & 0xff) >> 4;
unsigned b = ((col & 0xff) ) >> 4;
return (a << 12) | (b << 8) | (g << 4) | r;
}
#define argb32_to_pixel_platform_format(color) argb32_to_abgr4444(color)
#else
static uint16_t argb32_to_rgba4444(uint32_t col)