From 23d9812273d9c74af72ccdc3aa4cfea971f220a4 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 16 Jan 2009 10:34:40 +0000 Subject: 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 --- apps/plugins/cube.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'apps/plugins/cube.c') diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index d43f06f..9ba7a70 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -413,8 +413,6 @@ static long matrice[3][3]; static const int nb_points = 8; static long z_off = 600; -static const struct plugin_api* rb; - static void cube_rotate(int xa, int ya, int za) { int i; @@ -568,7 +566,7 @@ void cleanup(void *parameter) #endif } -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +enum plugin_status plugin_start(const void* parameter) { char buffer[30]; int t_disp = 0; @@ -587,14 +585,11 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame bool exit = false; (void)(parameter); - rb = api; #ifdef HAVE_LCD_BITMAP -#if LCD_DEPTH > 1 - xlcd_init(rb); -#elif defined(USE_GSLIB) +#if defined(USE_GSLIB) gbuf = (unsigned char *)rb->plugin_get_buffer(&gbuf_size); - if (!grey_init(rb, gbuf, gbuf_size, GREY_BUFFERED, + if (!grey_init(gbuf, gbuf_size, GREY_BUFFERED, LCD_WIDTH, LCD_HEIGHT, NULL)) { rb->splash(HZ, "Couldn't init greyscale display"); @@ -614,7 +609,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #endif rb->lcd_setfont(FONT_SYSFIXED); #else /* LCD_CHARCELLS */ - if (!pgfx_init(rb, 4, 2)) + if (!pgfx_init(4, 2)) { rb->splash(HZ*2, "Old LCD :("); return PLUGIN_OK; -- cgit v1.1