diff options
Diffstat (limited to 'apps/plugins/xworld/sys.c')
-rw-r--r-- | apps/plugins/xworld/sys.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index a240c75924..22fc92f7e2 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c | |||
@@ -448,7 +448,11 @@ void sys_setPalette(struct System* sys, uint8_t start, uint8_t n, const uint8_t | |||
448 | uint8_t col = buf[i * 3 + j]; | 448 | uint8_t col = buf[i * 3 + j]; |
449 | c[j] = (col << 2) | (col & 3); | 449 | c[j] = (col << 2) | (col & 3); |
450 | } | 450 | } |
451 | #if (LCD_DEPTH > 16) && (LCD_DEPTH <= 24) | 451 | #if (LCD_DEPTH > 24) |
452 | sys->palette[i] = (fb_data) { | ||
453 | c[2], c[1], c[0], 255 | ||
454 | }; | ||
455 | #elif (LCD_DEPTH > 16) && (LCD_DEPTH <= 24) | ||
452 | sys->palette[i] = (fb_data) { | 456 | sys->palette[i] = (fb_data) { |
453 | c[2], c[1], c[0] | 457 | c[2], c[1], c[0] |
454 | }; | 458 | }; |
@@ -621,7 +625,12 @@ void sys_copyRect(struct System* sys, uint16_t x, uint16_t y, uint16_t w, uint16 | |||
621 | #ifdef HAVE_LCD_COLOR | 625 | #ifdef HAVE_LCD_COLOR |
622 | int r, g, b; | 626 | int r, g, b; |
623 | fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x]; | 627 | fb_data pix = rb->lcd_framebuffer[y * LCD_WIDTH + x]; |
624 | #if (LCD_DEPTH == 24) | 628 | #if (LCD_DEPTH > 24) |
629 | r = 0xff - pix.r; | ||
630 | g = 0xff - pix.g; | ||
631 | b = 0xff - pix.b; | ||
632 | rb->lcd_framebuffer[y * LCD_WIDTH + x] = (fb_data) { b, g, r, 255 }; | ||
633 | #elif (LCD_DEPTH == 24) | ||
625 | r = 0xff - pix.r; | 634 | r = 0xff - pix.r; |
626 | g = 0xff - pix.g; | 635 | g = 0xff - pix.g; |
627 | b = 0xff - pix.b; | 636 | b = 0xff - pix.b; |