From d4027744b6d06919bcc33ba540c7d0e3fb9014b0 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Sat, 3 May 2008 14:55:34 +0000 Subject: Flashlight plugin: make color sets wrap around in both directions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17325 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/flashlight.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/plugins/flashlight.c b/apps/plugins/flashlight.c index e502d0e227..b732545ea6 100644 --- a/apps/plugins/flashlight.c +++ b/apps/plugins/flashlight.c @@ -139,7 +139,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #ifdef HAVE_LCD_COLOR do { - if((cs < 0) || (cs >= NUM_COLORSETS)) + if(cs < 0) + cs = NUM_COLORSETS-1; + if(cs >= NUM_COLORSETS) cs = 0; rb->lcd_set_background( LCD_RGBPACK( colorset[cs][0], colorset[cs][1], -- cgit v1.2.3