diff options
Diffstat (limited to 'apps/plugins/puzzles/rockbox.c')
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 7b838ddb79..59984a7891 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c | |||
@@ -111,7 +111,15 @@ static void zoom_drawpixel(int x, int y) | |||
111 | if(x < zoom_clipl || x >= zoom_clipr) | 111 | if(x < zoom_clipl || x >= zoom_clipr) |
112 | return; | 112 | return; |
113 | 113 | ||
114 | #if LCD_DEPTH == 24 | ||
115 | /* I hate these */ | ||
116 | unsigned int pix = rb->lcd_get_foreground(); | ||
117 | zoom_fb[y * zoom_w + x].b = RGB_UNPACK_BLUE(pix); | ||
118 | zoom_fb[y * zoom_w + x].g = RGB_UNPACK_GREEN(pix); | ||
119 | zoom_fb[y * zoom_w + x].r = RGB_UNPACK_RED(pix); | ||
120 | #else | ||
114 | zoom_fb[y * zoom_w + x] = rb->lcd_get_foreground(); | 121 | zoom_fb[y * zoom_w + x] = rb->lcd_get_foreground(); |
122 | #endif | ||
115 | } | 123 | } |
116 | 124 | ||
117 | static void zoom_hline(int l, int r, int y) | 125 | static void zoom_hline(int l, int r, int y) |
@@ -130,7 +138,14 @@ static void zoom_hline(int l, int r, int y) | |||
130 | if(r >= zoom_clipr) | 138 | if(r >= zoom_clipr) |
131 | r = zoom_clipr; | 139 | r = zoom_clipr; |
132 | 140 | ||
141 | #if LCD_DEPTH == 24 | ||
142 | fb_data pixel = { RGB_UNPACK_BLUE(rb->lcd_get_foreground()), | ||
143 | RGB_UNPACK_GREEN(rb->lcd_get_foreground()), | ||
144 | RGB_UNPACK_RED(rb->lcd_get_foreground()) }; | ||
145 | #else | ||
133 | fb_data pixel = rb->lcd_get_foreground(); | 146 | fb_data pixel = rb->lcd_get_foreground(); |
147 | #endif | ||
148 | |||
134 | fb_data *ptr = zoom_fb + y * zoom_w + l; | 149 | fb_data *ptr = zoom_fb + y * zoom_w + l; |
135 | for(int i = 0; i < r - l; ++i) | 150 | for(int i = 0; i < r - l; ++i) |
136 | *ptr++ = pixel; | 151 | *ptr++ = pixel; |
@@ -202,7 +217,15 @@ static void zoom_mono_bitmap(const unsigned char *bits, int x, int y, int w, int | |||
202 | for(int dy = 0; dy < 8; ++dy) | 217 | for(int dy = 0; dy < 8; ++dy) |
203 | { | 218 | { |
204 | if(column & 1) | 219 | if(column & 1) |
220 | { | ||
221 | #if LCD_DEPTH == 24 | ||
222 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].b = RGB_UNPACK_BLUE(LCD_BLACK); | ||
223 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].g = RGB_UNPACK_GREEN(LCD_BLACK); | ||
224 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j].r = RGB_UNPACK_RED(LCD_BLACK); | ||
225 | #else | ||
205 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j] = LCD_BLACK; | 226 | zoom_fb[(y + i * 8 + dy) * zoom_w + x + j] = LCD_BLACK; |
227 | #endif | ||
228 | } | ||
206 | column >>= 1; | 229 | column >>= 1; |
207 | } | 230 | } |
208 | } | 231 | } |
@@ -280,9 +303,9 @@ static void rb_unclip(void *handle) | |||
280 | else | 303 | else |
281 | { | 304 | { |
282 | zoom_clipu = 0; | 305 | zoom_clipu = 0; |
283 | zoom_clipd = LCD_HEIGHT; | 306 | zoom_clipd = zoom_h; |
284 | zoom_clipl = 0; | 307 | zoom_clipl = 0; |
285 | zoom_clipr = LCD_WIDTH; | 308 | zoom_clipr = zoom_w; |
286 | } | 309 | } |
287 | } | 310 | } |
288 | 311 | ||
@@ -522,11 +545,11 @@ static void rb_draw_rect(void *handle, int x, int y, int w, int h, int color) | |||
522 | else | 545 | else |
523 | { | 546 | { |
524 | /* TODO: clipping */ | 547 | /* TODO: clipping */ |
548 | rb_color(color); | ||
525 | for(int i = y; i < y + h; ++i) | 549 | for(int i = y; i < y + h; ++i) |
526 | for(int j = x; j < x + w; ++j) | 550 | { |
527 | { | 551 | zoom_hline(x, x + w, i); |
528 | zoom_fb[i * zoom_w + j] = colors[color]; | 552 | } |
529 | } | ||
530 | } | 553 | } |
531 | } | 554 | } |
532 | 555 | ||