summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-04-12 09:51:16 +0000
committerJens Arnold <amiconn@rockbox.org>2008-04-12 09:51:16 +0000
commitfef82552e19efd2f2a7c5918c650bbf39bfd454d (patch)
tree2f5676473bfc91b565b5825e053bacc93f8ad607
parentb6213bbf9889134c17065dc257c3cc08c7478490 (diff)
downloadrockbox-fef82552e19efd2f2a7c5918c650bbf39bfd454d.tar.gz
rockbox-fef82552e19efd2f2a7c5918c650bbf39bfd454d.zip
Optimise some more line drawing calls.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17083 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/calculator.c8
-rw-r--r--apps/plugins/calendar.c6
-rw-r--r--apps/plugins/clock/clock_draw_analog.c23
-rw-r--r--apps/plugins/metronome.c2
-rw-r--r--apps/plugins/pegbox.c2
-rw-r--r--apps/plugins/rockpaint.c8
-rw-r--r--apps/plugins/splitedit.c12
-rw-r--r--apps/plugins/superdom.c16
-rw-r--r--apps/plugins/vu_meter.c14
-rw-r--r--apps/plugins/wavview.c30
10 files changed, 53 insertions, 68 deletions
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 1cb1ee915d..979705fbe1 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -502,13 +502,11 @@ void cal_initial (void)
502 502
503 /* draw lines */ 503 /* draw lines */
504 rb->lcd_drawrect(X_0_POS, Y_0_POS, LCD_WIDTH-1, LCD_HEIGHT); 504 rb->lcd_drawrect(X_0_POS, Y_0_POS, LCD_WIDTH-1, LCD_HEIGHT);
505 rb->lcd_drawline(X_0_POS, Y_1_POS-1, X_5_POS, Y_1_POS-1); 505 rb->lcd_hline(X_0_POS, X_5_POS, Y_1_POS-1);
506 for (i = 0; i < 5 ; i++) 506 for (i = 0; i < 5 ; i++)
507 rb->lcd_drawline(X_0_POS, Y_1_POS+i*REC_HEIGHT, 507 rb->lcd_hline(X_0_POS, X_5_POS, Y_1_POS+i*REC_HEIGHT);
508 X_5_POS, Y_1_POS+i*REC_HEIGHT);
509 for (i = 0; i < 4 ; i++) 508 for (i = 0; i < 4 ; i++)
510 rb->lcd_drawline(X_1_POS+i*REC_WIDTH, Y_1_POS, 509 rb->lcd_vline(X_1_POS+i*REC_WIDTH, Y_1_POS, Y_6_POS);
511 X_1_POS+i*REC_WIDTH, Y_6_POS);
512 510
513#ifdef CALCULATOR_OPERATORS 511#ifdef CALCULATOR_OPERATORS
514 /* basic operators are available through separate button */ 512 /* basic operators are available through separate button */
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 8ed6122c3f..8798406b2e 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -114,7 +114,7 @@ static void draw_headers(void)
114 rb->lcd_putsxy(ws, 0 , Dayname[i++]); 114 rb->lcd_putsxy(ws, 0 , Dayname[i++]);
115 ws += space; 115 ws += space;
116 } 116 }
117 rb->lcd_drawline(0 ,h ,LCD_WIDTH-1 ,h); 117 rb->lcd_hline(0, LCD_WIDTH-1 ,h);
118} 118}
119 119
120static bool day_has_memo[31]; 120static bool day_has_memo[31];
@@ -170,8 +170,8 @@ static void draw_calendar(struct shown *shown)
170 ws = 2; 170 ws = 2;
171 } 171 }
172 } 172 }
173 rb->lcd_drawline(60,LCD_HEIGHT-h-3,60,LCD_HEIGHT-1); 173 rb->lcd_vline(60,LCD_HEIGHT-h-3,LCD_HEIGHT-1);
174 rb->lcd_drawline(60,LCD_HEIGHT-h-3,LCD_WIDTH-1,LCD_HEIGHT-h-3); 174 rb->lcd_hline(60,LCD_WIDTH-1,LCD_HEIGHT-h-3);
175 rb->snprintf(buffer,9,"%s %04d",Monthname[shown->mon-1],shown->year); 175 rb->snprintf(buffer,9,"%s %04d",Monthname[shown->mon-1],shown->year);
176 rb->lcd_putsxy(62,(LCD_HEIGHT-h-1),buffer); 176 rb->lcd_putsxy(62,(LCD_HEIGHT-h-1),buffer);
177 shown->lastday = pos; 177 shown->lastday = pos;
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c
index 0ab058e3fa..c4d12a83a2 100644
--- a/apps/plugins/clock/clock_draw_analog.c
+++ b/apps/plugins/clock/clock_draw_analog.c
@@ -220,20 +220,15 @@ void draw_hour(struct screen* display, struct time* time,
220 220
221void draw_center_cover(struct screen* display) 221void draw_center_cover(struct screen* display)
222{ 222{
223 display->drawline((display->width/2)-1, (display->height/2)+3, 223 display->hline((display->width/2)-1,
224 (display->width/2)+1, (display->height/2)+3); 224 (display->width/2)+1, (display->height/2)+3);
225 display->drawline((display->width/2)-3, (display->height/2)+2, 225 display->hline((display->width/2)-3,
226 (display->width/2)+3, (display->height/2)+2); 226 (display->width/2)+3, (display->height/2)+2);
227 display->drawline((display->width/2)-4, (display->height/2)+1, 227 display->fillrect((display->width/2)-4, (display->height/2)-1, 9, 3);
228 (display->width/2)+4, (display->height/2)+1); 228 display->hline((display->width/2)-3,
229 display->drawline((display->width/2)-4, display->height/2, 229 (display->width/2)+3, (display->height/2)-2);
230 (display->width/2)+4, display->height/2); 230 display->hline((display->width/2)-1,
231 display->drawline((display->width/2)-4, (display->height/2)-1, 231 (display->width/2)+1, (display->height/2)-3);
232 (display->width/2)+4, (display->height/2)-1);
233 display->drawline((display->width/2)-3, (display->height/2)-2,
234 (display->width/2)+3, (display->height/2)-2);
235 display->drawline((display->width/2)-1, (display->height/2)-3,
236 (display->width/2)+1, (display->height/2)-3);
237} 232}
238 233
239void analog_clock_draw(struct screen* display, struct time* time, 234void analog_clock_draw(struct screen* display, struct time* time,
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index d05e881f4f..a778429195 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -188,7 +188,7 @@ void metronome_draw(struct screen* display)
188#endif /* HAVE_LCD_BITMAP */ 188#endif /* HAVE_LCD_BITMAP */
189 189
190#ifdef HAVE_LCD_BITMAP 190#ifdef HAVE_LCD_BITMAP
191 display->drawline(0, 12, 111, 12); 191 display->hline(0, 111, 12);
192 if(sound_paused) 192 if(sound_paused)
193 display->puts(0,2,METRONOME_MSG_START); 193 display->puts(0,2,METRONOME_MSG_START);
194 else 194 else
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c
index 23fabf11c7..45c830a5a0 100644
--- a/apps/plugins/pegbox.c
+++ b/apps/plugins/pegbox.c
@@ -1000,7 +1000,7 @@ static unsigned int pegbox_menu(struct game_context* pb) {
1000 rb->lcd_putsxy((LCD_WIDTH)/4, 40, "Quit"); 1000 rb->lcd_putsxy((LCD_WIDTH)/4, 40, "Quit");
1001 1001
1002 if(!can_resume) 1002 if(!can_resume)
1003 rb->lcd_drawline((LCD_WIDTH)/4, 28, (LCD_WIDTH)/4+30, 28); 1003 rb->lcd_hline((LCD_WIDTH)/4, (LCD_WIDTH)/4+30, 28);
1004 1004
1005 rb->lcd_putsxy((LCD_WIDTH)/4-8, loc*8+16, "*"); 1005 rb->lcd_putsxy((LCD_WIDTH)/4-8, loc*8+16, "*");
1006 1006
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 7d5b5cbaa8..7e4aefddf2 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -2461,10 +2461,10 @@ static void inv_cursor(bool update)
2461 rb->lcd_set_foreground(COLOR_BLACK); 2461 rb->lcd_set_foreground(COLOR_BLACK);
2462 rb->lcd_set_drawmode(DRMODE_COMPLEMENT); 2462 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
2463 /* cross painting */ 2463 /* cross painting */
2464 rb->lcd_drawline(x-4,y,x-1,y); 2464 rb->lcd_hline(x-4,x-1,y);
2465 rb->lcd_drawline(x+1,y,x+4,y); 2465 rb->lcd_hline(x+1,x+4,y);
2466 rb->lcd_drawline(x,y-4,x,y-1); 2466 rb->lcd_vline(x,y-4,y-1);
2467 rb->lcd_drawline(x,y+1,x,y+4); 2467 rb->lcd_vline(x,y+1,y+4);
2468 rb->lcd_set_foreground(rp_colors[drawcolor]); 2468 rb->lcd_set_foreground(rp_colors[drawcolor]);
2469 rb->lcd_set_drawmode(DRMODE_SOLID); 2469 rb->lcd_set_drawmode(DRMODE_SOLID);
2470 2470
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index 7dd6be0408..ab4ce415b7 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -338,10 +338,10 @@ static void redraw_osci(void)
338 { 338 {
339 if (osci_buffer[x] > 0) 339 if (osci_buffer[x] > 0)
340 { 340 {
341 rb->lcd_drawline 341 rb->lcd_vline
342 ( 342 (
343 OSCI_X + x, OSCI_Y + OSCI_HEIGHT - 1, 343 OSCI_X + x, OSCI_Y + OSCI_HEIGHT - 1,
344 OSCI_X + x, OSCI_Y + OSCI_HEIGHT - osci_buffer[x] - 1 344 OSCI_Y + OSCI_HEIGHT - osci_buffer[x] - 1
345 ); 345 );
346 } 346 }
347 } 347 }
@@ -977,10 +977,10 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
977 int i; 977 int i;
978 for (i = lastx +1; i <= x; i++) 978 for (i = lastx +1; i <= x; i++)
979 { 979 {
980 rb->lcd_drawline 980 rb->lcd_vline
981 ( 981 (
982 i, OSCI_Y + OSCI_HEIGHT - 1, 982 i, OSCI_Y + OSCI_HEIGHT - 1,
983 i, OSCI_Y + OSCI_HEIGHT - osci_buffer[i - OSCI_X]-1 983 OSCI_Y + OSCI_HEIGHT - osci_buffer[i - OSCI_X]-1
984 ); 984 );
985 } 985 }
986 } 986 }
@@ -1007,8 +1007,8 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1007 ); 1007 );
1008 rb->lcd_set_drawmode(DRMODE_SOLID); 1008 rb->lcd_set_drawmode(DRMODE_SOLID);
1009 } 1009 }
1010 rb->lcd_drawline(split_x -2, OSCI_Y, split_x + 2, OSCI_Y); 1010 rb->lcd_hline(split_x -2, split_x + 2, OSCI_Y);
1011 rb->lcd_drawline(split_x-1, OSCI_Y+1, split_x +1,OSCI_Y+1); 1011 rb->lcd_hline(split_x-1, split_x +1,OSCI_Y+1);
1012 } 1012 }
1013 1013
1014 /* make visible */ 1014 /* make visible */
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index c047ed454a..fff141236e 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -355,12 +355,10 @@ void draw_board(void) {
355 } 355 }
356 rb->lcd_set_foreground(LCD_BLACK); 356 rb->lcd_set_foreground(LCD_BLACK);
357 for(i=0;i<=10;i++) { /* Draw Horizontal lines */ 357 for(i=0;i<=10;i++) { /* Draw Horizontal lines */
358 rb->lcd_drawline(MARGIN, MARGIN+(BOX_HEIGHT*i), MARGIN+(BOX_WIDTH*10), 358 rb->lcd_hline(MARGIN, MARGIN+(BOX_WIDTH*10), MARGIN+(BOX_HEIGHT*i));
359 MARGIN+(BOX_HEIGHT*i));
360 } 359 }
361 for(i=0;i<=10;i++) { /* Draw Vertical lines */ 360 for(i=0;i<=10;i++) { /* Draw Vertical lines */
362 rb->lcd_drawline(MARGIN+(BOX_WIDTH*i),MARGIN, MARGIN+(BOX_WIDTH*i), 361 rb->lcd_vline(MARGIN+(BOX_WIDTH*i), MARGIN, MARGIN+(BOX_HEIGHT*10));
363 MARGIN+(BOX_HEIGHT*10));
364 } 362 }
365 rb->lcd_update(); 363 rb->lcd_update();
366} 364}
@@ -688,14 +686,12 @@ int get_number(char* param, int* value) {
688 /* Draw a 3x4 grid */ 686 /* Draw a 3x4 grid */
689 int i,j,x=0,y=0; 687 int i,j,x=0,y=0;
690 for(i=0;i<=3;i++) { /* Vertical lines */ 688 for(i=0;i<=3;i++) { /* Vertical lines */
691 rb->lcd_drawline(NUM_MARGIN_X+(NUM_BOX_WIDTH*i), NUM_MARGIN_Y, 689 rb->lcd_vline(NUM_MARGIN_X+(NUM_BOX_WIDTH*i), NUM_MARGIN_Y,
692 NUM_MARGIN_X+(NUM_BOX_WIDTH*i), 690 NUM_MARGIN_Y+(4*NUM_BOX_HEIGHT));
693 NUM_MARGIN_Y+(4*NUM_BOX_HEIGHT));
694 } 691 }
695 for(i=0;i<=4;i++) { /* Horizontal lines */ 692 for(i=0;i<=4;i++) { /* Horizontal lines */
696 rb->lcd_drawline(NUM_MARGIN_X, NUM_MARGIN_Y+(i*NUM_BOX_HEIGHT), 693 rb->lcd_hline(NUM_MARGIN_X, NUM_MARGIN_X+(3*NUM_BOX_WIDTH),
697 NUM_MARGIN_X+(3*NUM_BOX_WIDTH), 694 NUM_MARGIN_Y+(NUM_BOX_HEIGHT*i));
698 NUM_MARGIN_Y+(NUM_BOX_HEIGHT*i));
699 } 695 }
700 int temp = 1; 696 int temp = 1;
701 for(i=0;i<3;i++) { 697 for(i=0;i<3;i++) {
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index f71118268e..5a893d7407 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -561,8 +561,8 @@ void analog_meter(void) {
561 rb->lcd_putsxy(half_width+quarter_width-12, 12, "Right"); 561 rb->lcd_putsxy(half_width+quarter_width-12, 12, "Right");
562 562
563 /* Line above/below the Left/Right text */ 563 /* Line above/below the Left/Right text */
564 rb->lcd_drawline(0,9,LCD_WIDTH-1,9); 564 rb->lcd_hline(0,LCD_WIDTH-1,9);
565 rb->lcd_drawline(0,21,LCD_WIDTH-1,21); 565 rb->lcd_hline(0,LCD_WIDTH-1,21);
566 566
567 for(i=0; i<half_width; i++) { 567 for(i=0; i<half_width; i++) {
568 rb->lcd_drawpixel(i, (y_values[i])-2); 568 rb->lcd_drawpixel(i, (y_values[i])-2);
@@ -613,18 +613,18 @@ void digital_meter(void) {
613 draw_digital_minimeters(); 613 draw_digital_minimeters();
614 614
615 /* Lines above/below where the LEDS are */ 615 /* Lines above/below where the LEDS are */
616 rb->lcd_drawline(0,12,LCD_WIDTH-1,12); 616 rb->lcd_hline(0,LCD_WIDTH-1,12);
617 rb->lcd_drawline(0,half_height-12,LCD_WIDTH-1,half_height-12); 617 rb->lcd_hline(0,LCD_WIDTH-1,half_height-12);
618 618
619 rb->lcd_drawline(0,half_height+18,LCD_WIDTH-1,half_height+18); 619 rb->lcd_hline(0,LCD_WIDTH-1,half_height+18);
620 rb->lcd_drawline(0,LCD_HEIGHT-6,LCD_WIDTH-1,LCD_HEIGHT-6); 620 rb->lcd_hline(0,LCD_WIDTH-1,LCD_HEIGHT-6);
621 621
622 /* Show Left/Right */ 622 /* Show Left/Right */
623 rb->lcd_putsxy(2, half_height-8, "Left"); 623 rb->lcd_putsxy(2, half_height-8, "Left");
624 rb->lcd_putsxy(2, half_height+8, "Right"); 624 rb->lcd_putsxy(2, half_height+8, "Right");
625 625
626 /* Line in the middle */ 626 /* Line in the middle */
627 rb->lcd_drawline(0,half_height+3,LCD_WIDTH-1,half_height+3); 627 rb->lcd_hline(0,LCD_WIDTH-1,half_height+3);
628} 628}
629 629
630enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { 630enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
diff --git a/apps/plugins/wavview.c b/apps/plugins/wavview.c
index fbf2e4383d..9ce873476f 100644
--- a/apps/plugins/wavview.c
+++ b/apps/plugins/wavview.c
@@ -289,26 +289,22 @@ int displaypeaks(void)
289 289
290 rb->lcd_clear_display(); 290 rb->lcd_clear_display();
291 291
292 rb->lcd_drawline(0, LEFTZERO - (0x8000 / YSCALE), LCD_WIDTH-1, 292 rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO - (0x8000 / YSCALE));
293 LEFTZERO - (0x8000 / YSCALE)); 293 rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO);
294 rb->lcd_drawline(0, LEFTZERO, LCD_WIDTH-1, LEFTZERO); 294 rb->lcd_hline(0, LCD_WIDTH-1, LEFTZERO + (0x8000 / YSCALE));
295 rb->lcd_drawline(0, LEFTZERO + (0x8000 / YSCALE), LCD_WIDTH-1, 295 rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO - (0x8000 / YSCALE));
296 LEFTZERO + (0x8000 / YSCALE)); 296 rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO);
297 rb->lcd_drawline(0, RIGHTZERO - (0x8000 / YSCALE), LCD_WIDTH-1, 297 rb->lcd_hline(0, LCD_WIDTH-1, RIGHTZERO + (0x8000 / YSCALE));
298 RIGHTZERO - (0x8000 / YSCALE));
299 rb->lcd_drawline(0, RIGHTZERO, LCD_WIDTH-1, RIGHTZERO);
300 rb->lcd_drawline(0, RIGHTZERO + (0x8000 / YSCALE), LCD_WIDTH-1,
301 RIGHTZERO + (0x8000 / YSCALE));
302 298
303#if LCD_DEPTH > 1 299#if LCD_DEPTH > 1
304 rb->lcd_set_foreground(LCD_BLACK); 300 rb->lcd_set_foreground(LCD_BLACK);
305#endif 301#endif
306 302
307 /* draw zoombar */ 303 /* draw zoombar */
308 rb->lcd_drawline(leftmargin / (mempeakcount / LCD_WIDTH), LCD_HEIGHT / 2, 304 rb->lcd_hline(leftmargin / (mempeakcount / LCD_WIDTH),
309 (leftmargin / (mempeakcount / LCD_WIDTH)) + 305 (leftmargin / (mempeakcount / LCD_WIDTH)) +
310 (LCD_WIDTH / zoomlevel), 306 (LCD_WIDTH / zoomlevel),
311 LCD_HEIGHT / 2); 307 LCD_HEIGHT / 2);
312 308
313 while((x < LCD_WIDTH) && (peakcount < mempeakcount)) 309 while((x < LCD_WIDTH) && (peakcount < mempeakcount))
314 { 310 {
@@ -324,10 +320,10 @@ int displaypeaks(void)
324 if(0 == (peakcount % ppp)) 320 if(0 == (peakcount % ppp))
325 { 321 {
326 /* drawing time */ 322 /* drawing time */
327 rb->lcd_drawline(x, LEFTZERO - (lymax / YSCALE), x, 323 rb->lcd_vline(x, LEFTZERO - (lymax / YSCALE),
328 LEFTZERO - (lymin / YSCALE)); 324 LEFTZERO - (lymin / YSCALE));
329 rb->lcd_drawline(x, RIGHTZERO - (rymax / YSCALE), x, 325 rb->lcd_vline(x, RIGHTZERO - (rymax / YSCALE),
330 RIGHTZERO - (rymin / YSCALE)); 326 RIGHTZERO - (rymin / YSCALE));
331 lymin = INT_MAX; 327 lymin = INT_MAX;
332 lymax = INT_MIN; 328 lymax = INT_MIN;
333 rymin = INT_MAX; 329 rymin = INT_MAX;