summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-06-29 01:39:50 +0000
committerJens Arnold <amiconn@rockbox.org>2005-06-29 01:39:50 +0000
commit576908d36a58d51ee880791418a32cef25b49aba (patch)
treeda2e34886085ca15de28d1b7226064be2906232b /apps
parent7e11acbce9b9a63c28ded055d02301175391e027 (diff)
downloadrockbox-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.c2
-rw-r--r--apps/plugin.c29
-rw-r--r--apps/plugin.h56
-rw-r--r--apps/plugins/logo.c8
-rw-r--r--apps/plugins/snow.c14
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 )
80 80
81#ifdef HAVE_REMOTE_LCD 81#ifdef HAVE_REMOTE_LCD
82 lcd_remote_clear_display(); 82 lcd_remote_clear_display();
83 lcd_remote_bitmap(rockbox112x37,10,14,112,37, false); 83 lcd_remote_bitmap(rockbox112x37,10,14,112,37);
84#endif 84#endif
85 85
86 snprintf(version, sizeof(version), "Ver. %s", appsversion); 86 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 = {
133 splash, 133 splash,
134#ifdef HAVE_REMOTE_LCD 134#ifdef HAVE_REMOTE_LCD
135 /* remote lcd */ 135 /* remote lcd */
136 lcd_remote_set_contrast,
136 lcd_remote_clear_display, 137 lcd_remote_clear_display,
137 lcd_remote_puts, 138 lcd_remote_puts,
138 lcd_remote_puts_scroll, 139 lcd_remote_puts_scroll,
139 lcd_remote_stop_scroll, 140 lcd_remote_stop_scroll,
140 lcd_remote_set_contrast, 141 lcd_remote_roll,
142 lcd_remote_set_drawmode,
143 lcd_remote_get_drawmode,
144 lcd_remote_setfont,
145 lcd_remote_getstringsize,
146 lcd_remote_drawpixel,
147 lcd_remote_drawline,
148 lcd_remote_hline,
149 lcd_remote_vline,
150 lcd_remote_drawrect,
151 lcd_remote_fillrect,
152 lcd_remote_bitmap_part,
153 lcd_remote_bitmap,
141 lcd_remote_putsxy, 154 lcd_remote_putsxy,
142 lcd_remote_puts_style, 155 lcd_remote_puts_style,
143 lcd_remote_puts_scroll_style, 156 lcd_remote_puts_scroll_style,
144 lcd_remote_bitmap, 157 &lcd_remote_framebuffer[0][0],
145 lcd_remote_drawline,
146 lcd_remote_clearline,
147 lcd_remote_drawpixel,
148 lcd_remote_clearpixel,
149 lcd_remote_setfont,
150 font_get,
151 lcd_remote_clearrect,
152 lcd_remote_fillrect,
153 lcd_remote_drawrect,
154 lcd_remote_invertrect,
155 lcd_remote_getstringsize,
156 lcd_remote_update, 158 lcd_remote_update,
157 lcd_remote_update_rect, 159 lcd_remote_update_rect,
158 160
159 lcd_remote_backlight_on, 161 lcd_remote_backlight_on,
160 lcd_remote_backlight_off, 162 lcd_remote_backlight_off,
161 &lcd_remote_framebuffer[0][0],
162#endif 163#endif
163 /* button */ 164 /* button */
164 button_get, 165 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 {
189 189
190#ifdef HAVE_REMOTE_LCD 190#ifdef HAVE_REMOTE_LCD
191 /* remote lcd */ 191 /* remote lcd */
192 void (*remote_clear_display)(void); 192 void (*lcd_remote_set_contrast)(int x);
193 void (*remote_puts)(int x, int y, const unsigned char *string); 193 void (*lcd_remote_clear_display)(void);
194 void (*remote_lcd_puts_scroll)(int x, int y, const unsigned char* string); 194 void (*lcd_remote_puts)(int x, int y, const unsigned char *string);
195 void (*remote_lcd_stop_scroll)(void); 195 void (*lcd_remote_lcd_puts_scroll)(int x, int y, const unsigned char* string);
196 void (*remote_set_contrast)(int x); 196 void (*lcd_remote_lcd_stop_scroll)(void);
197 197
198 void (*remote_putsxy)(int x, int y, const unsigned char *string); 198 void (*lcd_remote_roll)(int pixels);
199 void (*remote_puts_style)(int x, int y, const unsigned char *str, int style); 199
200 void (*remote_puts_scroll_style)(int x, int y, const unsigned char* string, 200 void (*lcd_remote_set_drawmode)(int mode);
201 int style); 201 int (*lcd_remote_get_drawmode)(void);
202 void (*remote_bitmap)(const unsigned char *src, int x, int y, 202 void (*lcd_remote_setfont)(int font);
203 int nx, int ny, bool clear); 203 int (*lcd_remote_getstringsize)(const unsigned char *str, int *w, int *h);
204 void (*remote_drawline)(int x1, int y1, int x2, int y2); 204 void (*lcd_remote_drawpixel)(int x, int y);
205 void (*remote_clearline)(int x1, int y1, int x2, int y2); 205 void (*lcd_remote_drawline)(int x1, int y1, int x2, int y2);
206 void (*remote_drawpixel)(int x, int y); 206 void (*lcd_remote_hline)(int x1, int x2, int y);
207 void (*remote_clearpixel)(int x, int y); 207 void (*lcd_remote_vline)(int x, int y1, int y2);
208 void (*remote_setfont)(int font); 208 void (*lcd_remote_drawrect)(int x, int y, int nx, int ny);
209 struct font* (*remote_font_get)(int font); 209 void (*lcd_remote_fillrect)(int x, int y, int nx, int ny);
210 void (*remote_clearrect)(int x, int y, int nx, int ny); 210 void (*lcd_remote_bitmap_part)(const unsigned char *src, int src_x,
211 void (*remote_fillrect)(int x, int y, int nx, int ny); 211 int src_y, int stride, int x, int y,
212 void (*remote_drawrect)(int x, int y, int nx, int ny); 212 int width, int height);
213 void (*remote_invertrect)(int x, int y, int nx, int ny); 213 void (*lcd_remote_bitmap)(const unsigned char *src, int x, int y, int nx,
214 int (*remote_getstringsize)(const unsigned char *str, int *w, int *h); 214 int ny);
215 void (*remote_update)(void); 215 void (*lcd_remote_putsxy)(int x, int y, const unsigned char *string);
216 void (*remote_update_rect)(int x, int y, int width, int height); 216 void (*lcd_remote_puts_style)(int x, int y, const unsigned char *str, int style);
217 void (*lcd_remote_puts_scroll_style)(int x, int y, const unsigned char* string,
218 int style);
219 unsigned char* lcd_remote_framebuffer;
220 void (*lcd_remote_update)(void);
221 void (*lcd_remote_update_rect)(int x, int y, int width, int height);
217 222
218 void (*remote_backlight_on)(void); 223 void (*remote_backlight_on)(void);
219 void (*remote_backlight_off)(void); 224 void (*remote_backlight_off)(void);
220 unsigned char* lcd_remote_framebuffer;
221#endif 225#endif
222 226
223 /* button */ 227 /* 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) {
231 rb->lcd_clear_display(); 231 rb->lcd_clear_display();
232 rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT); 232 rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT);
233#ifdef REMOTE_LOGO 233#ifdef REMOTE_LOGO
234 rb->remote_clear_display(); 234 rb->lcd_remote_clear_display();
235 rb->remote_bitmap(REMOTE_LOGO, 235 rb->lcd_remote_bitmap(REMOTE_LOGO,
236 (x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH), 236 (x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH),
237 (y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT), 237 (y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT),
238 REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT, false); 238 REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT);
239#endif 239#endif
240#else 240#else
241 pgfx_clear_display(); 241 pgfx_clear_display();
@@ -266,7 +266,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
266#ifdef HAVE_LCD_BITMAP 266#ifdef HAVE_LCD_BITMAP
267 rb->lcd_update(); 267 rb->lcd_update();
268#ifdef REMOTE_LOGO 268#ifdef REMOTE_LOGO
269 rb->remote_update(); 269 rb->lcd_remote_update();
270#endif 270#endif
271#else 271#else
272 if (cpos != old_cpos) { 272 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)
92#ifdef HAVE_REMOTE_LCD 92#ifdef HAVE_REMOTE_LCD
93 if (particles[i][0] <= LCD_REMOTE_WIDTH 93 if (particles[i][0] <= LCD_REMOTE_WIDTH
94 && particles[i][1] <= LCD_REMOTE_HEIGHT) { 94 && particles[i][1] <= LCD_REMOTE_HEIGHT) {
95 rb->remote_clearrect(particles[i][0],particles[i][1], 95 rb->lcd_remote_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
96 FLAKE_WIDTH,FLAKE_WIDTH); 96 rb->lcd_remote_fillrect(particles[i][0],particles[i][1],
97 FLAKE_WIDTH,FLAKE_WIDTH);
98 rb->lcd_remote_set_drawmode(DRMODE_SOLID);
97 } 99 }
98#endif 100#endif
99 switch ((rb->rand()%7)) { 101 switch ((rb->rand()%7)) {
@@ -122,8 +124,8 @@ static void snow_move(void)
122#ifdef HAVE_REMOTE_LCD 124#ifdef HAVE_REMOTE_LCD
123 if (particles[i][0] <= LCD_REMOTE_WIDTH 125 if (particles[i][0] <= LCD_REMOTE_WIDTH
124 && particles[i][1] <= LCD_REMOTE_HEIGHT) { 126 && particles[i][1] <= LCD_REMOTE_HEIGHT) {
125 rb->remote_bitmap(flake,particles[i][0],particles[i][1], 127 rb->lcd_remote_bitmap(flake,particles[i][0],particles[i][1],
126 FLAKE_WIDTH,FLAKE_WIDTH,true); 128 FLAKE_WIDTH,FLAKE_WIDTH);
127 } 129 }
128#endif 130#endif
129 } 131 }
@@ -148,7 +150,7 @@ static void snow_init(void)
148 pgfx_clear_display(); 150 pgfx_clear_display();
149#endif 151#endif
150#ifdef HAVE_REMOTE_LCD 152#ifdef HAVE_REMOTE_LCD
151 rb->remote_clear_display(); 153 rb->lcd_remote_clear_display();
152#endif 154#endif
153} 155}
154 156
@@ -175,7 +177,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
175 pgfx_update(); 177 pgfx_update();
176#endif 178#endif
177#ifdef HAVE_REMOTE_LCD 179#ifdef HAVE_REMOTE_LCD
178 rb->remote_update(); 180 rb->lcd_remote_update();
179#endif 181#endif
180 rb->sleep(HZ/20); 182 rb->sleep(HZ/20);
181 183