From 93867305d514b90bec2d5d7541297aef6a157efa Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 30 Jun 2005 21:07:00 +0000 Subject: Player graphics library extended and converted to new api. Please note that the player gfx bitmap format chas changed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6956 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/snow.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'apps/plugins/snow.c') diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index b3d3b14c46..75c561427a 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c @@ -23,10 +23,12 @@ #define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72) #define SNOW_HEIGHT LCD_HEIGHT #define SNOW_WIDTH LCD_WIDTH +#define MYLCD(fn) rb->lcd_ ## fn #else #define NUM_PARTICLES 10 #define SNOW_HEIGHT 14 #define SNOW_WIDTH 20 +#define MYLCD(fn) pgfx_ ## fn #endif /* variable button definitions */ @@ -81,14 +83,14 @@ static void snow_move(void) for (i=0; ilcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_fillrect(particles[i][0],particles[i][1], FLAKE_WIDTH,FLAKE_WIDTH); - rb->lcd_set_drawmode(DRMODE_SOLID); #else - pgfx_clearpixel(particles[i][0],particles[i][1]); + pgfx_drawpixel(particles[i][0],particles[i][1]); #endif + MYLCD(set_drawmode)(DRMODE_SOLID); #ifdef HAVE_REMOTE_LCD if (particles[i][0] <= LCD_REMOTE_WIDTH && particles[i][1] <= LCD_REMOTE_HEIGHT) { @@ -141,14 +143,12 @@ static void snow_init(void) particles[i][0]=-1; particles[i][1]=-1; } -#ifdef HAVE_LCD_BITMAP - rb->lcd_clear_display(); -#else +#ifdef HAVE_LCD_CHARCELLS pgfx_display(0, 0); /* display three times */ pgfx_display(4, 0); pgfx_display(8, 0); - pgfx_clear_display(); #endif + MYLCD(clear_display)(); #ifdef HAVE_REMOTE_LCD rb->lcd_remote_clear_display(); #endif @@ -171,11 +171,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) snow_init(); while (1) { snow_move(); -#ifdef HAVE_LCD_BITMAP - rb->lcd_update(); -#else - pgfx_update(); -#endif + MYLCD(update)(); #ifdef HAVE_REMOTE_LCD rb->lcd_remote_update(); #endif -- cgit v1.2.3