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.tar.gz rockbox-d352b2d2bce82c618243e31777f82e724e732550.zip |
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 0cc12fee2f..97bca2dbc4 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c | |||
@@ -18,10 +18,7 @@ | |||
18 | * | 18 | * |
19 | ***************************************************************************/ | 19 | ***************************************************************************/ |
20 | #include "plugin.h" | 20 | #include "plugin.h" |
21 | |||
22 | #ifdef HAVE_LCD_CHARCELLS | ||
23 | #include "playergfx.h" | 21 | #include "playergfx.h" |
24 | #endif | ||
25 | 22 | ||
26 | /* Loops that the values are displayed */ | 23 | /* Loops that the values are displayed */ |
27 | #define DISP_TIME 30 | 24 | #define DISP_TIME 30 |
@@ -315,6 +312,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
315 | rb->splash(HZ*2, true, "Old LCD :("); | 312 | rb->splash(HZ*2, true, "Old LCD :("); |
316 | return PLUGIN_OK; | 313 | return PLUGIN_OK; |
317 | } | 314 | } |
315 | pgfx_display(3, 0); | ||
318 | #endif | 316 | #endif |
319 | 317 | ||
320 | cube_init(); | 318 | cube_init(); |
@@ -338,7 +336,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
338 | if (t_disp>0) | 336 | if (t_disp>0) |
339 | { | 337 | { |
340 | t_disp--; | 338 | t_disp--; |
341 | rb->snprintf(buffer, 30, "x:%d y:%d z:%d h:%d",xs,ys,zs,highspeed); | 339 | rb->snprintf(buffer, sizeof(buffer), "x:%d y:%d z:%d h:%d", |
340 | xs, ys, zs, highspeed); | ||
342 | rb->lcd_putsxy(0, LCD_HEIGHT-8, buffer); | 341 | rb->lcd_putsxy(0, LCD_HEIGHT-8, buffer); |
343 | } | 342 | } |
344 | rb->lcd_update(); | 343 | rb->lcd_update(); |
@@ -347,25 +346,24 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
347 | { | 346 | { |
348 | if (t_disp == DISP_TIME) | 347 | if (t_disp == DISP_TIME) |
349 | { | 348 | { |
350 | rb->snprintf(buffer, 30, "x%d", xs); | 349 | rb->snprintf(buffer, sizeof(buffer), "x%d", xs); |
351 | rb->lcd_puts(0, 0, buffer); | 350 | rb->lcd_puts(0, 0, buffer); |
352 | rb->snprintf(buffer, 30, "y%d", ys); | 351 | rb->snprintf(buffer, sizeof(buffer), "y%d", ys); |
353 | rb->lcd_puts(8, 0, buffer); | ||
354 | rb->snprintf(buffer, 30, "z%d", zs); | ||
355 | rb->lcd_puts(0, 1, buffer); | 352 | rb->lcd_puts(0, 1, buffer); |
356 | rb->snprintf(buffer, 30, "h%d", highspeed); | 353 | pgfx_display(3, 0); |
354 | rb->snprintf(buffer, sizeof(buffer), "z%d", zs); | ||
355 | rb->lcd_puts(8, 0, buffer); | ||
356 | rb->snprintf(buffer, sizeof(buffer), "h%d", highspeed); | ||
357 | rb->lcd_puts(8, 1, buffer); | 357 | rb->lcd_puts(8, 1, buffer); |
358 | } | 358 | } |
359 | t_disp--; | 359 | t_disp--; |
360 | if (t_disp == 0) | 360 | if (t_disp == 0) |
361 | { | 361 | { |
362 | rb->lcd_puts(0, 0, " "); | 362 | rb->lcd_clear_display(); |
363 | rb->lcd_puts(8, 0, " "); | 363 | pgfx_display(3, 0); |
364 | rb->lcd_puts(0, 1, " "); | ||
365 | rb->lcd_puts(8, 1, " "); | ||
366 | } | 364 | } |
367 | } | 365 | } |
368 | pgfx_display(3, 0); | 366 | pgfx_update(); |
369 | #endif | 367 | #endif |
370 | 368 | ||
371 | xa+=xs; | 369 | xa+=xs; |
@@ -437,7 +435,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
437 | 435 | ||
438 | default: | 436 | default: |
439 | if(rb->default_event_handler(button) == SYS_USB_CONNECTED) | 437 | if(rb->default_event_handler(button) == SYS_USB_CONNECTED) |
438 | { | ||
439 | #ifdef HAVE_LCD_CHARCELLS | ||
440 | pgfx_release(); | ||
441 | #endif | ||
440 | return PLUGIN_USB_CONNECTED; | 442 | return PLUGIN_USB_CONNECTED; |
443 | } | ||
441 | break; | 444 | break; |
442 | } | 445 | } |
443 | if (button!=BUTTON_NONE) | 446 | if (button!=BUTTON_NONE) |