diff options
| author | Kevin Ferrare <kevin@rockbox.org> | 2007-07-19 03:49:43 +0000 |
|---|---|---|
| committer | Kevin Ferrare <kevin@rockbox.org> | 2007-07-19 03:49:43 +0000 |
| commit | e68a2e6c41c50a3b14b368112573ab91f2a148bf (patch) | |
| tree | a41780a6bed30cff6677a0c782185cd3c8f08999 /apps/plugins/demystify.c | |
| parent | f074b4635b558238b4debad4ebf14fa675496d23 (diff) | |
| download | rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.zip rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.tar.gz rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.tar.bz2 rockbox-e68a2e6c41c50a3b14b368112573ab91f2a148bf.tar.xz | |
Remote keys support for the demystify plugin (added remote_directions to the plugins actions), updated key bindings in manual
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13927 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/demystify.c')
| -rw-r--r-- | apps/plugins/demystify.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 0cb06ee..1ea9806 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -47,7 +47,11 @@ PLUGIN_HEADER #define DEMYSTIFY_REMOVE_POLYGON_REPEAT PLA_DOWN_REPEAT const struct button_mapping *plugin_contexts[] -= {generic_directions, generic_actions}; += {generic_directions, generic_actions, +#if defined(HAVE_REMOTE_LCD) + remote_directions +#endif +}; #ifdef HAVE_LCD_COLOR struct line_color @@ -293,8 +297,17 @@ void color_change(struct line_color * color) color_randomize(color); } -#define COLOR_RGBPACK(color) LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) +#define COLOR_RGBPACK(color) \ + LCD_RGBPACK((color)->current_r, (color)->current_g, (color)->current_b) +void color_apply(struct line_color * color, struct screen * display) +{ + if (display->is_color){ + unsigned foreground= + SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(color)); + display->set_foreground(foreground); + } +} #endif /* @@ -352,13 +365,8 @@ int plugin_main(void) polygon_update(&leading_polygon[i], display, &move[i]); /* Now the drawing part */ - #ifdef HAVE_LCD_COLOR - if (display->is_color){ - unsigned foreground= - SCREEN_COLOR_TO_NATIVE(display,COLOR_RGBPACK(&color)); - display->set_foreground(foreground); - } + color_apply(&color, display); #endif display->clear_display(); polygons_draw(&polygons[i], display); @@ -373,7 +381,7 @@ int plugin_main(void) else rb->sleep(sleep_time); - action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 2); + action = pluginlib_getaction(rb, TIMEOUT_NOBLOCK, plugin_contexts, 3); switch(action) { case DEMYSTIFY_QUIT: |