From fbb6a2ff6d751adaaef73a86a98700f91571d0a1 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Fri, 2 Mar 2018 21:53:55 +0100 Subject: Agptek Rocker: Build plugins Patch provided by Aapo Tahkola. Change-Id: I37a42a950d78d6b8aa3927ec7aeb30030f7be7a5 --- apps/plugins/puzzles/rockbox.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'apps/plugins/puzzles/rockbox.c') diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index e681db3c16..88186b5154 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c @@ -177,7 +177,13 @@ static void zoom_drawpixel(int x, int y) if(x < zoom_clipl || x >= zoom_clipr) return; -#if LCD_DEPTH == 24 +#if LCD_DEPTH > 24 + unsigned int pix = rb->lcd_get_foreground(); + zoom_fb[y * zoom_w + x].b = RGB_UNPACK_BLUE(pix); + zoom_fb[y * zoom_w + x].g = RGB_UNPACK_GREEN(pix); + zoom_fb[y * zoom_w + x].r = RGB_UNPACK_RED(pix); + zoom_fb[y * zoom_w + x].x = 255; +#elif LCD_DEPTH == 24 /* I hate these */ unsigned int pix = rb->lcd_get_foreground(); zoom_fb[y * zoom_w + x].b = RGB_UNPACK_BLUE(pix); @@ -204,7 +210,13 @@ static void zoom_hline(int l, int r, int y) if(r >= zoom_clipr) r = zoom_clipr; -#if LCD_DEPTH == 24 +#if LCD_DEPTH > 24 + fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), + RGB_UNPACK_GREEN(rb->lcd_get_foreground()), + RGB_UNPACK_RED(rb->lcd_get_foreground()), + 255 + }; +#elif LCD_DEPTH == 24 fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), RGB_UNPACK_GREEN(rb->lcd_get_foreground()), RGB_UNPACK_RED(rb->lcd_get_foreground()) }; @@ -285,7 +297,12 @@ static void zoom_mono_bitmap(const unsigned char *bits, int x, int y, int w, int { if(column & 1) { -#if LCD_DEPTH == 24 +#if LCD_DEPTH > 24 + zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(pix); + zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(pix); + zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = RGB_UNPACK_RED(pix); + zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = 255; +#elif LCD_DEPTH == 24 zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(pix); zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(pix); zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = RGB_UNPACK_RED(pix); @@ -625,7 +642,7 @@ static inline void plot(fb_data *fb, int w, int h, fb_data *ptr = fb + y * w + x; fb_data orig = *ptr; unsigned long r2, g2, b2; -#if LCD_DEPTH != 24 +#if LCD_DEPTH < 24 r2 = RGB_UNPACK_RED(orig); g2 = RGB_UNPACK_GREEN(orig); b2 = RGB_UNPACK_BLUE(orig); @@ -640,8 +657,10 @@ static inline void plot(fb_data *fb, int w, int h, g = ((g1 * a) + (g2 * (256 - a))) >> 8; b = ((b1 * a) + (b2 * (256 - a))) >> 8; -#if LCD_DEPTH != 24 +#if LCD_DEPTH < 24 *ptr = LCD_RGBPACK(r, g, b); +#elif LCD_DEPTH > 24 + *ptr = (fb_data) {b, g, r, 255}; #else *ptr = (fb_data) {b, g, r}; #endif @@ -1454,7 +1473,7 @@ void get_random_seed(void **randseed, int *randseedsize) static void timer_cb(void) { -#if LCD_DEPTH != 24 +#if LCD_DEPTH < 24 if(debug_settings.timerflash) { static bool what = false; -- cgit v1.2.3