diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-02-11 19:38:14 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-02-11 19:38:14 +0000 |
| commit | d352b2d2bce82c618243e31777f82e724e732550 (patch) | |
| tree | eaeb35560c9126ceefeb325900068dbc47617f0d /apps/plugins | |
| parent | b66f94b03dc6d2d6b9478274ba69607f14cbd39e (diff) | |
| download | rockbox-d352b2d2bce82c618243e31777f82e724e732550.zip rockbox-d352b2d2bce82c618243e31777f82e724e732550.tar.gz rockbox-d352b2d2bce82c618243e31777f82e724e732550.tar.bz2 rockbox-d352b2d2bce82c618243e31777f82e724e732550.tar.xz | |
Adapted to new playergfx lib, release playergfx in all return cases, some optimisation for player.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5917 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/cube.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 0cc12fe..97bca2d 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -18,10 +18,7 @@ * ***************************************************************************/ #include "plugin.h" - -#ifdef HAVE_LCD_CHARCELLS #include "playergfx.h" -#endif /* Loops that the values are displayed */ #define DISP_TIME 30 @@ -315,6 +312,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb->splash(HZ*2, true, "Old LCD :("); return PLUGIN_OK; } + pgfx_display(3, 0); #endif cube_init(); @@ -338,7 +336,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) if (t_disp>0) { t_disp--; - rb->snprintf(buffer, 30, "x:%d y:%d z:%d h:%d",xs,ys,zs,highspeed); + rb->snprintf(buffer, sizeof(buffer), "x:%d y:%d z:%d h:%d", + xs, ys, zs, highspeed); rb->lcd_putsxy(0, LCD_HEIGHT-8, buffer); } rb->lcd_update(); @@ -347,25 +346,24 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { if (t_disp == DISP_TIME) { - rb->snprintf(buffer, 30, "x%d", xs); + rb->snprintf(buffer, sizeof(buffer), "x%d", xs); rb->lcd_puts(0, 0, buffer); - rb->snprintf(buffer, 30, "y%d", ys); - rb->lcd_puts(8, 0, buffer); - rb->snprintf(buffer, 30, "z%d", zs); + rb->snprintf(buffer, sizeof(buffer), "y%d", ys); rb->lcd_puts(0, 1, buffer); - rb->snprintf(buffer, 30, "h%d", highspeed); + pgfx_display(3, 0); + rb->snprintf(buffer, sizeof(buffer), "z%d", zs); + rb->lcd_puts(8, 0, buffer); + rb->snprintf(buffer, sizeof(buffer), "h%d", highspeed); rb->lcd_puts(8, 1, buffer); } t_disp--; if (t_disp == 0) { - rb->lcd_puts(0, 0, " "); - rb->lcd_puts(8, 0, " "); - rb->lcd_puts(0, 1, " "); - rb->lcd_puts(8, 1, " "); + rb->lcd_clear_display(); + pgfx_display(3, 0); } } - pgfx_display(3, 0); + pgfx_update(); #endif xa+=xs; @@ -437,7 +435,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) default: if(rb->default_event_handler(button) == SYS_USB_CONNECTED) + { +#ifdef HAVE_LCD_CHARCELLS + pgfx_release(); +#endif return PLUGIN_USB_CONNECTED; + } break; } if (button!=BUTTON_NONE) |