diff options
Diffstat (limited to 'apps/plugins/puzzles/rockbox.c')
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 31 |
1 files changed, 25 insertions, 6 deletions
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) | |||
177 | if(x < zoom_clipl || x >= zoom_clipr) | 177 | if(x < zoom_clipl || x >= zoom_clipr) |
178 | return; | 178 | return; |
179 | 179 | ||
180 | #if LCD_DEPTH == 24 | 180 | #if LCD_DEPTH > 24 |
181 | unsigned int pix = rb->lcd_get_foreground(); | ||
182 | zoom_fb[y * zoom_w + x].b = RGB_UNPACK_BLUE(pix); | ||
183 | zoom_fb[y * zoom_w + x].g = RGB_UNPACK_GREEN(pix); | ||
184 | zoom_fb[y * zoom_w + x].r = RGB_UNPACK_RED(pix); | ||
185 | zoom_fb[y * zoom_w + x].x = 255; | ||
186 | #elif LCD_DEPTH == 24 | ||
181 | /* I hate these */ | 187 | /* I hate these */ |
182 | unsigned int pix = rb->lcd_get_foreground(); | 188 | unsigned int pix = rb->lcd_get_foreground(); |
183 | zoom_fb[y * zoom_w + x].b = RGB_UNPACK_BLUE(pix); | 189 | 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) | |||
204 | if(r >= zoom_clipr) | 210 | if(r >= zoom_clipr) |
205 | r = zoom_clipr; | 211 | r = zoom_clipr; |
206 | 212 | ||
207 | #if LCD_DEPTH == 24 | 213 | #if LCD_DEPTH > 24 |
214 | fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), | ||
215 | RGB_UNPACK_GREEN(rb->lcd_get_foreground()), | ||
216 | RGB_UNPACK_RED(rb->lcd_get_foreground()), | ||
217 | 255 | ||
218 | }; | ||
219 | #elif LCD_DEPTH == 24 | ||
208 | fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), | 220 | fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), |
209 | RGB_UNPACK_GREEN(rb->lcd_get_foreground()), | 221 | RGB_UNPACK_GREEN(rb->lcd_get_foreground()), |
210 | RGB_UNPACK_RED(rb->lcd_get_foreground()) }; | 222 | 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 | |||
285 | { | 297 | { |
286 | if(column & 1) | 298 | if(column & 1) |
287 | { | 299 | { |
288 | #if LCD_DEPTH == 24 | 300 | #if LCD_DEPTH > 24 |
301 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(pix); | ||
302 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(pix); | ||
303 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = RGB_UNPACK_RED(pix); | ||
304 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = 255; | ||
305 | #elif LCD_DEPTH == 24 | ||
289 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(pix); | 306 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(pix); |
290 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(pix); | 307 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(pix); |
291 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = RGB_UNPACK_RED(pix); | 308 | 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, | |||
625 | fb_data *ptr = fb + y * w + x; | 642 | fb_data *ptr = fb + y * w + x; |
626 | fb_data orig = *ptr; | 643 | fb_data orig = *ptr; |
627 | unsigned long r2, g2, b2; | 644 | unsigned long r2, g2, b2; |
628 | #if LCD_DEPTH != 24 | 645 | #if LCD_DEPTH < 24 |
629 | r2 = RGB_UNPACK_RED(orig); | 646 | r2 = RGB_UNPACK_RED(orig); |
630 | g2 = RGB_UNPACK_GREEN(orig); | 647 | g2 = RGB_UNPACK_GREEN(orig); |
631 | b2 = RGB_UNPACK_BLUE(orig); | 648 | b2 = RGB_UNPACK_BLUE(orig); |
@@ -640,8 +657,10 @@ static inline void plot(fb_data *fb, int w, int h, | |||
640 | g = ((g1 * a) + (g2 * (256 - a))) >> 8; | 657 | g = ((g1 * a) + (g2 * (256 - a))) >> 8; |
641 | b = ((b1 * a) + (b2 * (256 - a))) >> 8; | 658 | b = ((b1 * a) + (b2 * (256 - a))) >> 8; |
642 | 659 | ||
643 | #if LCD_DEPTH != 24 | 660 | #if LCD_DEPTH < 24 |
644 | *ptr = LCD_RGBPACK(r, g, b); | 661 | *ptr = LCD_RGBPACK(r, g, b); |
662 | #elif LCD_DEPTH > 24 | ||
663 | *ptr = (fb_data) {b, g, r, 255}; | ||
645 | #else | 664 | #else |
646 | *ptr = (fb_data) {b, g, r}; | 665 | *ptr = (fb_data) {b, g, r}; |
647 | #endif | 666 | #endif |
@@ -1454,7 +1473,7 @@ void get_random_seed(void **randseed, int *randseedsize) | |||
1454 | 1473 | ||
1455 | static void timer_cb(void) | 1474 | static void timer_cb(void) |
1456 | { | 1475 | { |
1457 | #if LCD_DEPTH != 24 | 1476 | #if LCD_DEPTH < 24 |
1458 | if(debug_settings.timerflash) | 1477 | if(debug_settings.timerflash) |
1459 | { | 1478 | { |
1460 | static bool what = false; | 1479 | static bool what = false; |