summaryrefslogtreecommitdiff
path: root/apps/plugins/maze.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/maze.c')
-rw-r--r--apps/plugins/maze.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c
index 67c0623dec..881d804400 100644
--- a/apps/plugins/maze.c
+++ b/apps/plugins/maze.c
@@ -85,9 +85,6 @@ static const struct button_mapping *plugin_contexts[]
85#define BORDER_S(y) ((y) == MAZE_HEIGHT-1) 85#define BORDER_S(y) ((y) == MAZE_HEIGHT-1)
86#define BORDER_W(x) ((x) == 0) 86#define BORDER_W(x) ((x) == 0)
87 87
88/* the API */
89static const struct plugin_api* rb;
90
91// we can and should change this to make square boxes 88// we can and should change this to make square boxes
92#if ( LCD_WIDTH == 112 ) 89#if ( LCD_WIDTH == 112 )
93#define MAZE_WIDTH 16 90#define MAZE_WIDTH 16
@@ -493,17 +490,16 @@ static void maze_move_player_left(struct maze* maze)
493/**********************************/ 490/**********************************/
494/* this is the plugin entry point */ 491/* this is the plugin entry point */
495/**********************************/ 492/**********************************/
496enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) 493enum plugin_status plugin_start(const void* parameter)
497{ 494{
498 int button, lastbutton = BUTTON_NONE; 495 int button, lastbutton = BUTTON_NONE;
499 int quit = 0; 496 int quit = 0;
500 int i; 497 int i;
501 struct maze maze; 498 struct maze maze;
502 (void)parameter; 499 (void)parameter;
503 rb = api;
504 500
505 /* Turn off backlight timeout */ 501 /* Turn off backlight timeout */
506 backlight_force_on(rb); /* backlight control in lib/helper.c */ 502 backlight_force_on(); /* backlight control in lib/helper.c */
507 503
508 /* Seed the RNG */ 504 /* Seed the RNG */
509 rb->srand(*rb->current_tick); 505 rb->srand(*rb->current_tick);
@@ -531,7 +527,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
531 527
532 while(!quit) { 528 while(!quit) {
533#ifdef __PLUGINLIB_ACTIONS_H__ 529#ifdef __PLUGINLIB_ACTIONS_H__
534 button = pluginlib_getaction(rb, TIMEOUT_BLOCK, plugin_contexts, 2); 530 button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, 2);
535#else 531#else
536 button = rb->button_get(true); 532 button = rb->button_get(true);
537#endif 533#endif
@@ -591,6 +587,6 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
591 587
592 } 588 }
593 /* Turn on backlight timeout (revert to settings) */ 589 /* Turn on backlight timeout (revert to settings) */
594 backlight_use_settings(rb); /* backlight control in lib/helper.c */ 590 backlight_use_settings(); /* backlight control in lib/helper.c */
595 return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED); 591 return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED);
596} 592}