summaryrefslogtreecommitdiff
path: root/apps/plugins/cube.c
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-01-16 10:34:40 +0000
commit23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch)
tree8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/cube.c
parent35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff)
downloadrockbox-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/cube.c')
-rw-r--r--apps/plugins/cube.c13
1 files changed, 4 insertions, 9 deletions
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;