diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/clock/clock.c | 11 | ||||
-rw-r--r-- | apps/plugins/jackpot.c | 26 |
2 files changed, 13 insertions, 24 deletions
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){ | |||
174 | break; | 174 | break; |
175 | 175 | ||
176 | default: | 176 | default: |
177 | redraw=false; | ||
178 | if(rb->default_event_handler_ex(button, cleanup, NULL) | 177 | if(rb->default_event_handler_ex(button, cleanup, NULL) |
179 | == SYS_USB_CONNECTED) | 178 | == SYS_USB_CONNECTED) |
180 | return PLUGIN_USB_CONNECTED; | 179 | return PLUGIN_USB_CONNECTED; |
180 | if(time.second != last_second){ | ||
181 | last_second=time.second; | ||
182 | redraw=true; | ||
183 | }else | ||
184 | redraw=false; | ||
181 | break; | 185 | break; |
182 | } | 186 | } |
183 | if(time.second != last_second){ | 187 | |
184 | last_second=time.second; | ||
185 | redraw=true; | ||
186 | } | ||
187 | if(redraw){ | 188 | if(redraw){ |
188 | clock_draw_set_colors(); | 189 | clock_draw_set_colors(); |
189 | FOR_NB_SCREENS(i) | 190 | 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 @@ | |||
19 | 19 | ||
20 | #include "plugin.h" | 20 | #include "plugin.h" |
21 | #include "pluginlib_actions.h" | 21 | #include "pluginlib_actions.h" |
22 | #include "picture.h" | ||
22 | 23 | ||
23 | PLUGIN_HEADER | 24 | PLUGIN_HEADER |
24 | 25 | ||
@@ -52,32 +53,19 @@ static unsigned long char_patterns[NB_SLOTS]; | |||
52 | #define PICTURE_ROTATION_STEPS REMOTE_PICTURE_HEIGHT | 53 | #define PICTURE_ROTATION_STEPS REMOTE_PICTURE_HEIGHT |
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | struct jackpot_picture{ | ||
56 | const void* data; | ||
57 | int width; | ||
58 | int height; | ||
59 | }; | ||
60 | |||
61 | /* FIXME: would be nice to have better graphics ... */ | 56 | /* FIXME: would be nice to have better graphics ... */ |
62 | #include "jackpot_slots.h" | 57 | #include "jackpot_slots.h" |
63 | #if NB_SCREENS==2 | 58 | #if NB_SCREENS==2 |
64 | #include "jackpot_slots_remote.h" | 59 | #include "jackpot_slots_remote.h" |
65 | #endif | 60 | #endif |
66 | 61 | ||
67 | const struct jackpot_picture jackpot_pictures[]={ | 62 | const struct picture jackpot_pictures[]={ |
68 | { | 63 | {jackpot_slots, BMPWIDTH_jackpot_slots,PICTURE_HEIGHT}, |
69 | jackpot_slots, | ||
70 | BMPWIDTH_jackpot_slots, | ||
71 | PICTURE_HEIGHT | ||
72 | }, | ||
73 | #if NB_SCREENS==2 | 64 | #if NB_SCREENS==2 |
74 | { | 65 | {jackpot_slots_remote,BMPWIDTH_jackpot_slots_remote,REMOTE_PICTURE_HEIGHT} |
75 | jackpot_slots_remote, | ||
76 | BMPWIDTH_jackpot_slots_remote, | ||
77 | REMOTE_PICTURE_HEIGHT | ||
78 | } | ||
79 | #endif | 66 | #endif |
80 | }; | 67 | }; |
68 | |||
81 | #define SLEEP_TIME (HZ/100) | 69 | #define SLEEP_TIME (HZ/100) |
82 | #endif /* HAVE_LCD_CHARCELLS */ | 70 | #endif /* HAVE_LCD_CHARCELLS */ |
83 | 71 | ||
@@ -182,8 +170,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display) | |||
182 | #ifdef HAVE_LCD_CHARCELLS | 170 | #ifdef HAVE_LCD_CHARCELLS |
183 | display->putc(0, 0, '['); | 171 | display->putc(0, 0, '['); |
184 | #else | 172 | #else |
185 | const struct jackpot_picture* picture= | 173 | const struct picture* picture= &(jackpot_pictures[display->screen_type]); |
186 | &(jackpot_pictures[display->screen_type]); | ||
187 | int pos_x=(display->width-NB_SLOTS*(picture->width+1))/2; | 174 | int pos_x=(display->width-NB_SLOTS*(picture->width+1))/2; |
188 | int pos_y=(display->height-(picture->height))/2; | 175 | int pos_y=(display->height-(picture->height))/2; |
189 | #endif /* HAVE_LCD_CHARCELLS */ | 176 | #endif /* HAVE_LCD_CHARCELLS */ |
@@ -216,6 +203,7 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display) | |||
216 | /* Position on the screen */ | 203 | /* Position on the screen */ |
217 | pos_x, pos_y, picture->width, picture->height | 204 | pos_x, pos_y, picture->width, picture->height |
218 | ); | 205 | ); |
206 | vertical_picture_draw_part(display, picture, state_y, pos_x, pos_y); | ||
219 | pos_x+=(picture->width+1); | 207 | pos_x+=(picture->width+1); |
220 | #endif | 208 | #endif |
221 | } | 209 | } |