(RGUI) Cleanups

This commit is contained in:
twinaphex 2017-08-15 17:56:42 +02:00
parent ade279c0ba
commit 09cf3262f1
1 changed files with 7 additions and 17 deletions

View File

@ -78,7 +78,7 @@ static uint16_t argb32_to_rgba4444(uint32_t col)
unsigned a = ((col >> 24) & 0xff) >> 4; unsigned a = ((col >> 24) & 0xff) >> 4;
unsigned r = ((col >> 16) & 0xff) >> 4; unsigned r = ((col >> 16) & 0xff) >> 4;
unsigned g = ((col >> 8) & 0xff) >> 4; unsigned g = ((col >> 8) & 0xff) >> 4;
unsigned b = (col & 0xff) >> 4; unsigned b = ((col & 0xff) ) >> 4;
return (r << 12) | (g << 8) | (b << 4) | a; return (r << 12) | (g << 8) | (b << 4) | a;
} }
#endif #endif
@ -110,11 +110,7 @@ static void rgui_copy_glyph(uint8_t *glyph, const uint8_t *buf)
static uint16_t rgui_gray_filler(unsigned x, unsigned y) static uint16_t rgui_gray_filler(unsigned x, unsigned y)
{ {
unsigned col; unsigned col = (((x >> 1) + (y >> 1)) & 1) + 1;
x >>= 1;
y >>= 1;
col = ((x + y) & 1) + 1;
#if defined(GEKKO) || defined(PSP) #if defined(GEKKO) || defined(PSP)
return (6 << 12) | (col << 8) | (col << 4) | (col << 0); return (6 << 12) | (col << 8) | (col << 4) | (col << 0);
@ -125,11 +121,7 @@ static uint16_t rgui_gray_filler(unsigned x, unsigned y)
static uint16_t rgui_green_filler(unsigned x, unsigned y) static uint16_t rgui_green_filler(unsigned x, unsigned y)
{ {
unsigned col; unsigned col = (((x >> 1) + (y >> 1)) & 1) + 1;
x >>= 1;
y >>= 1;
col = ((x + y) & 1) + 1;
#if defined(GEKKO) || defined(PSP) #if defined(GEKKO) || defined(PSP)
return (6 << 12) | (col << 8) | (col << 5) | (col << 0); return (6 << 12) | (col << 8) | (col << 5) | (col << 0);
#else #else
@ -186,9 +178,7 @@ static void blit_line(int x, int y,
int offset = (i + j * FONT_WIDTH) >> 3; int offset = (i + j * FONT_WIDTH) >> 3;
bool col = (font_fb[FONT_OFFSET(symbol) + offset] & rem); bool col = (font_fb[FONT_OFFSET(symbol) + offset] & rem);
if (!col) if (col)
continue;
rgui_framebuf_data[(y + j) * (pitch >> 1) + (x + i)] = color; rgui_framebuf_data[(y + j) * (pitch >> 1) + (x + i)] = color;
} }
} }