From 1d91334428137e7c1991c4a917143a7a5ff6ad0a Mon Sep 17 00:00:00 2001 From: Kevin Ferrare Date: Sat, 4 Aug 2007 15:13:28 +0000 Subject: made the jackpot plugin use the new common sprite functions, cosmetic change to the clock plugin's code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14182 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/clock/clock.c | 11 ++++++----- apps/plugins/jackpot.c | 26 +++++++------------------- 2 files changed, 13 insertions(+), 24 deletions(-) (limited to 'apps') diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index e9985a13ab..bb42b51430 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c @@ -174,16 +174,17 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){ break; default: - redraw=false; if(rb->default_event_handler_ex(button, cleanup, NULL) == SYS_USB_CONNECTED) return PLUGIN_USB_CONNECTED; + if(time.second != last_second){ + last_second=time.second; + redraw=true; + }else + redraw=false; break; } - if(time.second != last_second){ - last_second=time.second; - redraw=true; - } + if(redraw){ clock_draw_set_colors(); FOR_NB_SCREENS(i) diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index e5518b7bbc..aa573db46a 100644 --- a/apps/plugins/jackpot.c +++ b/apps/plugins/jackpot.c @@ -19,6 +19,7 @@ #include "plugin.h" #include "pluginlib_actions.h" +#include "picture.h" PLUGIN_HEADER @@ -52,32 +53,19 @@ static unsigned long char_patterns[NB_SLOTS]; #define PICTURE_ROTATION_STEPS REMOTE_PICTURE_HEIGHT #endif -struct jackpot_picture{ - const void* data; - int width; - int height; -}; - /* FIXME: would be nice to have better graphics ... */ #include "jackpot_slots.h" #if NB_SCREENS==2 #include "jackpot_slots_remote.h" #endif -const struct jackpot_picture jackpot_pictures[]={ - { - jackpot_slots, - BMPWIDTH_jackpot_slots, - PICTURE_HEIGHT - }, +const struct picture jackpot_pictures[]={ + {jackpot_slots, BMPWIDTH_jackpot_slots,PICTURE_HEIGHT}, #if NB_SCREENS==2 - { - jackpot_slots_remote, - BMPWIDTH_jackpot_slots_remote, - REMOTE_PICTURE_HEIGHT - } + {jackpot_slots_remote,BMPWIDTH_jackpot_slots_remote,REMOTE_PICTURE_HEIGHT} #endif }; + #define SLEEP_TIME (HZ/100) #endif /* HAVE_LCD_CHARCELLS */ @@ -182,8 +170,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display) #ifdef HAVE_LCD_CHARCELLS display->putc(0, 0, '['); #else - const struct jackpot_picture* picture= - &(jackpot_pictures[display->screen_type]); + const struct picture* picture= &(jackpot_pictures[display->screen_type]); int pos_x=(display->width-NB_SLOTS*(picture->width+1))/2; int pos_y=(display->height-(picture->height))/2; #endif /* HAVE_LCD_CHARCELLS */ @@ -216,6 +203,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display) /* Position on the screen */ pos_x, pos_y, picture->width, picture->height ); + vertical_picture_draw_part(display, picture, state_y, pos_x, pos_y); pos_x+=(picture->width+1); #endif } -- cgit v1.2.3