diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
| commit | 23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch) | |
| tree | 8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/bubbles.c | |
| parent | 35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff) | |
| download | rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.zip rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.gz rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.bz2 rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.xz | |
loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api
the loader uses this pointer to initialize rb before calling entry_point
entry_point is no longer passed a pointer to the plugin API
all plugins, and pluginlib functions, are modified to refer to the
global rb
pluginlib functions which only served to copy the API pointer are
removed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/bubbles.c')
| -rw-r--r-- | apps/plugins/bubbles.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index 0894c75..5e33858 100644 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c @@ -203,9 +203,6 @@ PLUGIN_HEADER /* collision distance squared */ #define MIN_DISTANCE ((BUBBLE_WIDTH*8)/10)*((BUBBLE_HEIGHT*8)/10) -/* global rockbox api */ -static const struct plugin_api* rb; - /* levels */ char level[NUM_LEVELS][BB_LEVEL_HEIGHT][BB_WIDTH] = { {{ 6, 6, 4, 4, 2, 2, 3, 3}, @@ -2317,7 +2314,7 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock, if (timeout < 0) timeout = 0; - button = pluginlib_getaction(rb,timeout,plugin_contexts,2); + button = pluginlib_getaction(timeout,plugin_contexts,2); #if defined(HAS_BUTTON_HOLD) && !defined(HAVE_REMOTE_LCD_AS_MAIN) /* FIXME: Should probably check remote hold here */ if (rb->button_hold()) @@ -2352,7 +2349,7 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock, case BUBBLES_START: /* pause the game */ start = *rb->current_tick; rb->splash(0, "Paused"); - while(pluginlib_getaction(rb,TIMEOUT_BLOCK,plugin_contexts,2) + while(pluginlib_getaction(TIMEOUT_BLOCK,plugin_contexts,2) != (BUBBLES_START)); bb->startedshot += *rb->current_tick-start; bubbles_drawboard(bb); @@ -2480,19 +2477,15 @@ static int bubbles(struct game_context* bb) { /***************************************************************************** * plugin entry point. ******************************************************************************/ -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { +enum plugin_status plugin_start(const void* parameter) { struct game_context bb; bool exit = false; int position; /* plugin init */ (void)parameter; - rb = api; /* end of plugin init */ - /* more init */ - xlcd_init(rb); - /* load files */ rb->splash(0, "Loading..."); bubbles_loadscores(&bb); |