diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-29 01:39:50 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-29 01:39:50 +0000 |
commit | 576908d36a58d51ee880791418a32cef25b49aba (patch) | |
tree | da2e34886085ca15de28d1b7226064be2906232b /apps | |
parent | 7e11acbce9b9a63c28ded055d02301175391e027 (diff) | |
download | rockbox-576908d36a58d51ee880791418a32cef25b49aba.tar.gz rockbox-576908d36a58d51ee880791418a32cef25b49aba.zip |
Third part of graphics api rework. Some small but effective optimisations. Ported remote lcd driver to new api. Preparations for including the low-level functions in the plugin api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6907 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/main_menu.c | 2 | ||||
-rw-r--r-- | apps/plugin.c | 29 | ||||
-rw-r--r-- | apps/plugin.h | 56 | ||||
-rw-r--r-- | apps/plugins/logo.c | 8 | ||||
-rw-r--r-- | apps/plugins/snow.c | 14 |
5 files changed, 58 insertions, 51 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index 9654b806e3..46a3e6f4a5 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -80,7 +80,7 @@ int show_logo( void ) #ifdef HAVE_REMOTE_LCD lcd_remote_clear_display(); - lcd_remote_bitmap(rockbox112x37,10,14,112,37, false); + lcd_remote_bitmap(rockbox112x37,10,14,112,37); #endif snprintf(version, sizeof(version), "Ver. %s", appsversion); diff --git a/apps/plugin.c b/apps/plugin.c index 2a8d2c0841..bd8ea2f9a6 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -133,32 +133,33 @@ static const struct plugin_api rockbox_api = { splash, #ifdef HAVE_REMOTE_LCD /* remote lcd */ + lcd_remote_set_contrast, lcd_remote_clear_display, lcd_remote_puts, lcd_remote_puts_scroll, lcd_remote_stop_scroll, - lcd_remote_set_contrast, + lcd_remote_roll, + lcd_remote_set_drawmode, + lcd_remote_get_drawmode, + lcd_remote_setfont, + lcd_remote_getstringsize, + lcd_remote_drawpixel, + lcd_remote_drawline, + lcd_remote_hline, + lcd_remote_vline, + lcd_remote_drawrect, + lcd_remote_fillrect, + lcd_remote_bitmap_part, + lcd_remote_bitmap, lcd_remote_putsxy, lcd_remote_puts_style, lcd_remote_puts_scroll_style, - lcd_remote_bitmap, - lcd_remote_drawline, - lcd_remote_clearline, - lcd_remote_drawpixel, - lcd_remote_clearpixel, - lcd_remote_setfont, - font_get, - lcd_remote_clearrect, - lcd_remote_fillrect, - lcd_remote_drawrect, - lcd_remote_invertrect, - lcd_remote_getstringsize, + &lcd_remote_framebuffer[0][0], lcd_remote_update, lcd_remote_update_rect, lcd_remote_backlight_on, lcd_remote_backlight_off, - &lcd_remote_framebuffer[0][0], #endif /* button */ button_get, diff --git a/apps/plugin.h b/apps/plugin.h index 78bffe08ed..b2e798d0e8 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -189,35 +189,39 @@ struct plugin_api { #ifdef HAVE_REMOTE_LCD /* remote lcd */ - void (*remote_clear_display)(void); - void (*remote_puts)(int x, int y, const unsigned char *string); - void (*remote_lcd_puts_scroll)(int x, int y, const unsigned char* string); - void (*remote_lcd_stop_scroll)(void); - void (*remote_set_contrast)(int x); - - void (*remote_putsxy)(int x, int y, const unsigned char *string); - void (*remote_puts_style)(int x, int y, const unsigned char *str, int style); - void (*remote_puts_scroll_style)(int x, int y, const unsigned char* string, - int style); - void (*remote_bitmap)(const unsigned char *src, int x, int y, - int nx, int ny, bool clear); - void (*remote_drawline)(int x1, int y1, int x2, int y2); - void (*remote_clearline)(int x1, int y1, int x2, int y2); - void (*remote_drawpixel)(int x, int y); - void (*remote_clearpixel)(int x, int y); - void (*remote_setfont)(int font); - struct font* (*remote_font_get)(int font); - void (*remote_clearrect)(int x, int y, int nx, int ny); - void (*remote_fillrect)(int x, int y, int nx, int ny); - void (*remote_drawrect)(int x, int y, int nx, int ny); - void (*remote_invertrect)(int x, int y, int nx, int ny); - int (*remote_getstringsize)(const unsigned char *str, int *w, int *h); - void (*remote_update)(void); - void (*remote_update_rect)(int x, int y, int width, int height); + void (*lcd_remote_set_contrast)(int x); + void (*lcd_remote_clear_display)(void); + void (*lcd_remote_puts)(int x, int y, const unsigned char *string); + void (*lcd_remote_lcd_puts_scroll)(int x, int y, const unsigned char* string); + void (*lcd_remote_lcd_stop_scroll)(void); + + void (*lcd_remote_roll)(int pixels); + + void (*lcd_remote_set_drawmode)(int mode); + int (*lcd_remote_get_drawmode)(void); + void (*lcd_remote_setfont)(int font); + int (*lcd_remote_getstringsize)(const unsigned char *str, int *w, int *h); + void (*lcd_remote_drawpixel)(int x, int y); + void (*lcd_remote_drawline)(int x1, int y1, int x2, int y2); + void (*lcd_remote_hline)(int x1, int x2, int y); + void (*lcd_remote_vline)(int x, int y1, int y2); + void (*lcd_remote_drawrect)(int x, int y, int nx, int ny); + void (*lcd_remote_fillrect)(int x, int y, int nx, int ny); + void (*lcd_remote_bitmap_part)(const unsigned char *src, int src_x, + int src_y, int stride, int x, int y, + int width, int height); + void (*lcd_remote_bitmap)(const unsigned char *src, int x, int y, int nx, + int ny); + void (*lcd_remote_putsxy)(int x, int y, const unsigned char *string); + void (*lcd_remote_puts_style)(int x, int y, const unsigned char *str, int style); + void (*lcd_remote_puts_scroll_style)(int x, int y, const unsigned char* string, + int style); + unsigned char* lcd_remote_framebuffer; + void (*lcd_remote_update)(void); + void (*lcd_remote_update_rect)(int x, int y, int width, int height); void (*remote_backlight_on)(void); void (*remote_backlight_off)(void); - unsigned char* lcd_remote_framebuffer; #endif /* button */ diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c index 7807982ebc..abe4e0bc3b 100644 --- a/apps/plugins/logo.c +++ b/apps/plugins/logo.c @@ -231,11 +231,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { rb->lcd_clear_display(); rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT); #ifdef REMOTE_LOGO - rb->remote_clear_display(); - rb->remote_bitmap(REMOTE_LOGO, + rb->lcd_remote_clear_display(); + rb->lcd_remote_bitmap(REMOTE_LOGO, (x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH), (y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT), - REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT, false); + REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT); #endif #else pgfx_clear_display(); @@ -266,7 +266,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { #ifdef HAVE_LCD_BITMAP rb->lcd_update(); #ifdef REMOTE_LOGO - rb->remote_update(); + rb->lcd_remote_update(); #endif #else if (cpos != old_cpos) { diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index 36181e6eae..b3d3b14c46 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c @@ -92,8 +92,10 @@ static void snow_move(void) #ifdef HAVE_REMOTE_LCD if (particles[i][0] <= LCD_REMOTE_WIDTH && particles[i][1] <= LCD_REMOTE_HEIGHT) { - rb->remote_clearrect(particles[i][0],particles[i][1], - FLAKE_WIDTH,FLAKE_WIDTH); + rb->lcd_remote_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + rb->lcd_remote_fillrect(particles[i][0],particles[i][1], + FLAKE_WIDTH,FLAKE_WIDTH); + rb->lcd_remote_set_drawmode(DRMODE_SOLID); } #endif switch ((rb->rand()%7)) { @@ -122,8 +124,8 @@ static void snow_move(void) #ifdef HAVE_REMOTE_LCD if (particles[i][0] <= LCD_REMOTE_WIDTH && particles[i][1] <= LCD_REMOTE_HEIGHT) { - rb->remote_bitmap(flake,particles[i][0],particles[i][1], - FLAKE_WIDTH,FLAKE_WIDTH,true); + rb->lcd_remote_bitmap(flake,particles[i][0],particles[i][1], + FLAKE_WIDTH,FLAKE_WIDTH); } #endif } @@ -148,7 +150,7 @@ static void snow_init(void) pgfx_clear_display(); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_clear_display(); + rb->lcd_remote_clear_display(); #endif } @@ -175,7 +177,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) pgfx_update(); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_update(); + rb->lcd_remote_update(); #endif rb->sleep(HZ/20); |