summaryrefslogtreecommitdiff
path: root/apps/plugins/demystify.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/demystify.c')
-rw-r--r--apps/plugins/demystify.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index 0cb06ee473..1ea9806a7b 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -47,7 +47,11 @@ PLUGIN_HEADER
47#define DEMYSTIFY_REMOVE_POLYGON_REPEAT PLA_DOWN_REPEAT 47#define DEMYSTIFY_REMOVE_POLYGON_REPEAT PLA_DOWN_REPEAT
48 48
49const struct button_mapping *plugin_contexts[] 49const struct button_mapping *plugin_contexts[]
50= {generic_directions, generic_actions}; 50= {generic_directions, generic_actions,
51#if defined(HAVE_REMOTE_LCD)
52 remote_directions
53#endif
54};
51 55
52#ifdef HAVE_LCD_COLOR 56#ifdef HAVE_LCD_COLOR
53struct line_color 57struct line_color
@@ -293,8 +297,17 @@ void color_change(struct line_color * color)
293 color_randomize(color); 297 color_randomize(color);
294} 298}
295 299
296#define COLOR_RGBPACK(color) LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) 300#define COLOR_RGBPACK(color) \
301 LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b)
297 302
303void color_apply(struct line_color * color, struct screen * display)
304{
305 if (display->is_color){
306 unsigned foreground=
307 SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(color));
308 display->set_foreground(foreground);
309 }
310}
298#endif 311#endif
299 312
300/* 313/*
@@ -352,13 +365,8 @@ int plugin_main(void)
352 polygon_update(&leading_polygon[i], display, &move[i]); 365 polygon_update(&leading_polygon[i], display, &move[i]);
353 366
354 /* Now the drawing part */ 367 /* Now the drawing part */
355
356#ifdef HAVE_LCD_COLOR 368#ifdef HAVE_LCD_COLOR
357 if (display->is_color){ 369 color_apply(&color, display);
358 unsigned foreground=
359 SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(&color));
360 display->set_foreground(foreground);
361 }
362#endif 370#endif
363 display->clear_display(); 371 display->clear_display();
364 polygons_draw(&polygons[i], display); 372 polygons_draw(&polygons[i], display);
@@ -373,7 +381,7 @@ int plugin_main(void)
373 else 381 else
374 rb->sleep(sleep_time); 382 rb->sleep(sleep_time);
375 383
376 action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 2); 384 action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 3);
377 switch(action) 385 switch(action)
378 { 386 {
379 case DEMYSTIFY_QUIT: 387 case DEMYSTIFY_QUIT: