diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-09-24 18:04:15 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-09-24 18:04:15 +0000 |
commit | a4c3b03f15eefd516224e429215258bffa0221de (patch) | |
tree | 84ab843fdeaed0010f09a5de80ba679258e4fcd3 /apps/recorder | |
parent | 614272c45f6235b01685d3aa48b5a154f9362c10 (diff) | |
download | rockbox-a4c3b03f15eefd516224e429215258bffa0221de.tar.gz rockbox-a4c3b03f15eefd516224e429215258bffa0221de.zip |
Removed lcd_getfontsize(). Removed font parameters to lcd_putsxy and lcd_getstringsize.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2403 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/bounce.c | 16 | ||||
-rw-r--r-- | apps/recorder/icons.c | 15 | ||||
-rw-r--r-- | apps/recorder/oscillograph.c | 6 | ||||
-rw-r--r-- | apps/recorder/sokoban.c | 27 | ||||
-rw-r--r-- | apps/recorder/tetris.c | 6 | ||||
-rw-r--r-- | apps/recorder/wormlet.c | 54 |
6 files changed, 64 insertions, 60 deletions
diff --git a/apps/recorder/bounce.c b/apps/recorder/bounce.c index fc11aefe68..cfb194e7ec 100644 --- a/apps/recorder/bounce.c +++ b/apps/recorder/bounce.c @@ -224,7 +224,7 @@ static void loopit(void) } snprintf(buffer, 30, "%s: %d", values[show].what, values[show].num); - lcd_putsxy(0, 56, buffer, 0); + lcd_putsxy(0, 56, buffer); timeout--; } for(i=0, yy=y, xx=x; @@ -241,13 +241,13 @@ static void loopit(void) } -Menu bounce(void) +bool bounce(void) { int w, h; char *off = "[Off] to stop"; int len = strlen(SS_TITLE); - lcd_getfontsize(SS_TITLE_FONT, &w, &h); + lcd_getstringsize(SS_TITLE,&w, &h); /* Get horizontel centering for text */ len *= w; @@ -262,10 +262,10 @@ Menu bounce(void) h /= 2; lcd_clear_display(); - lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE, SS_TITLE_FONT); + lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE); - len = strlen(off); - lcd_getfontsize(0, &w, &h); + len = 1; + lcd_getstringsize(off, &w, &h); /* Get horizontel centering for text */ len *= w; @@ -279,13 +279,13 @@ Menu bounce(void) else h /= 2; - lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off,0); + lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off); lcd_update(); sleep(HZ); loopit(); - return MENU_OK; + return false; } #endif diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 76169fe0ee..6414a17418 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -235,10 +235,12 @@ void statusbar_icon_volume(int percent) /* display volume lever numerical? */ if (TIME_BEFORE(current_tick,switch_tick)) { snprintf(buffer, sizeof(buffer), "%2d", percent); - lcd_getstringsize(buffer, FONT_SYSFIXED, &width, &height); + lcd_setfont(FONT_SYSFIXED); + lcd_getstringsize(buffer, &width, &height); if (height <= STATUSBAR_HEIGHT) lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 - - width/2, STATUSBAR_Y_POS, buffer, FONT_SYSFIXED); + width/2, STATUSBAR_Y_POS, buffer); + lcd_setfont(FONT_UI); } else { /* display volume bar */ volume = volume * 14 / 100; @@ -246,7 +248,8 @@ void statusbar_icon_volume(int percent) if(i%2 == 0) step++; for(j=1; j <= step; j++) - lcd_drawpixel(ICON_VOLUME_X_POS + i, STATUSBAR_Y_POS + 7 - j); + lcd_drawpixel(ICON_VOLUME_X_POS + i, + STATUSBAR_Y_POS + 7 - j); } } } @@ -307,8 +310,10 @@ void statusbar_time(int hour, int minute) strncpy(buffer, "--:--", sizeof buffer); } - lcd_getstringsize(buffer, FONT_SYSFIXED, &width, &height); + lcd_setfont(FONT_SYSFIXED); + lcd_getstringsize(buffer, &width, &height); if (height <= STATUSBAR_HEIGHT) - lcd_putsxy(TIME_X_END - width, STATUSBAR_Y_POS, buffer, FONT_SYSFIXED); + lcd_putsxy(TIME_X_END - width, STATUSBAR_Y_POS, buffer); + lcd_setfont(FONT_UI); } #endif diff --git a/apps/recorder/oscillograph.c b/apps/recorder/oscillograph.c index c3b76c4626..25ae10f01b 100644 --- a/apps/recorder/oscillograph.c +++ b/apps/recorder/oscillograph.c @@ -45,7 +45,7 @@ static int drawMode = DRAW_MODE_FILLED; * hardware scrolling of the display. The user can change * speed */ -Menu oscillograph(void) +bool oscillograph(void) { /* stores current volume value left */ int left; @@ -184,7 +184,7 @@ Menu oscillograph(void) if (draw) { char buf[16]; snprintf(buf, sizeof buf, "Speed: %d", -speed); - lcd_putsxy(0, (y + LCD_HEIGHT - 8) % LCD_HEIGHT, buf, 0); + lcd_putsxy(0, (y + LCD_HEIGHT - 8) % LCD_HEIGHT, buf); lcd_update_rect(0, (y + LCD_HEIGHT - 8) % LCD_HEIGHT, LCD_WIDTH, 8); } @@ -197,5 +197,5 @@ Menu oscillograph(void) lcd_update(); /* standard return */ - return MENU_OK; + return false; } diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c index 3e5d447ae9..68961f775d 100644 --- a/apps/recorder/sokoban.c +++ b/apps/recorder/sokoban.c @@ -1846,14 +1846,14 @@ static void update_screen(void) { snprintf (s, sizeof(s), "%d", current_level+1); - lcd_putsxy (86, 22, s, 0); + lcd_putsxy (86, 22, s); snprintf (s, sizeof(s), "%d", moves); - lcd_putsxy (86, 54, s, 0); + lcd_putsxy (86, 54, s); lcd_drawrect (80,0,32,32); lcd_drawrect (80,32,32,64); - lcd_putsxy (81, 10, str(LANG_SOKOBAN_LEVEL), 0); - lcd_putsxy (81, 42, str(LANG_SOKOBAN_MOVE), 0); + lcd_putsxy (81, 10, str(LANG_SOKOBAN_LEVEL)); + lcd_putsxy (81, 42, str(LANG_SOKOBAN_MOVE)); /* print out the screen */ lcd_update(); } @@ -2197,7 +2197,7 @@ static bool sokoban_loop(void) if (current_level == NUM_LEVELS) { for(ii=0; ii<30 ; ii++) { lcd_clear_display(); - lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN), 2); + lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN)); lcd_update(); lcd_invertrect(0,0,111,63); lcd_update(); @@ -2220,12 +2220,12 @@ bool sokoban(void) { bool result; int w, h; - int len = strlen(SOKOBAN_TITLE); + int len; - lcd_getfontsize(SOKOBAN_TITLE_FONT, &w, &h); + lcd_getstringsize(SOKOBAN_TITLE, &w, &h); /* Get horizontel centering for text */ - len *= w; + len = w; if (len%2 != 0) len = ((len+1)/2)+(w/2); else @@ -2237,18 +2237,17 @@ bool sokoban(void) h /= 2; lcd_clear_display(); - lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SOKOBAN_TITLE, - SOKOBAN_TITLE_FONT); + lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SOKOBAN_TITLE); lcd_update(); sleep(HZ*2); lcd_clear_display(); - lcd_putsxy( 3,12, str(LANG_SOKOBAN_QUIT), 0); - lcd_putsxy( 3,22, str(LANG_SOKOBAN_F1),0); - lcd_putsxy( 3,32, str(LANG_SOKOBAN_F2),0); - lcd_putsxy( 3,42, str(LANG_SOKOBAN_F3),0); + lcd_putsxy( 3,12, str(LANG_SOKOBAN_QUIT)); + lcd_putsxy( 3,22, str(LANG_SOKOBAN_F1)); + lcd_putsxy( 3,32, str(LANG_SOKOBAN_F2)); + lcd_putsxy( 3,42, str(LANG_SOKOBAN_F3)); lcd_update(); sleep(HZ*2); diff --git a/apps/recorder/tetris.c b/apps/recorder/tetris.c index 5264b8e789..53012fd717 100644 --- a/apps/recorder/tetris.c +++ b/apps/recorder/tetris.c @@ -319,7 +319,7 @@ static void move_down(void) } snprintf (s, sizeof(s), "%d Rows - Level %d", lines, level); - lcd_putsxy (2, 42, s, 0); + lcd_putsxy (2, 42, s); new_block(); move_block(0,0,0); @@ -371,7 +371,7 @@ static bool game_loop(void) if(gameover()) { lcd_clearrect(0, 52, LCD_WIDTH, LCD_HEIGHT - 52); - lcd_putsxy (2, 52, str(LANG_TETRIS_LOSE), 0); + lcd_putsxy (2, 52, str(LANG_TETRIS_LOSE)); lcd_update(); sleep(HZ * 3); return false; @@ -403,7 +403,7 @@ bool tetris(void) init_tetris(); draw_frame(start_x, start_x + max_x - 1, start_y - 1, start_y + max_y); - lcd_putsxy (2, 42, str(LANG_TETRIS_LEVEL), 0); + lcd_putsxy (2, 42, str(LANG_TETRIS_LEVEL)); lcd_update(); next_b = t_rand(blocks); diff --git a/apps/recorder/wormlet.c b/apps/recorder/wormlet.c index 0edd550966..5fb48aa48e 100644 --- a/apps/recorder/wormlet.c +++ b/apps/recorder/wormlet.c @@ -1213,8 +1213,8 @@ static void score_board(void) snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_CRASHED)); break; } - lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf, 0); - lcd_putsxy(FIELD_RECT_WIDTH + 3, y+8, buf2, 0); + lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf); + lcd_putsxy(FIELD_RECT_WIDTH + 3, y+8, buf2); if (!worms[i].alive){ lcd_invertrect(FIELD_RECT_WIDTH + 2, y, @@ -1224,9 +1224,9 @@ static void score_board(void) } snprintf(buf , sizeof(buf), str(LANG_WORMLET_HIGHSCORE), highscore); #ifndef DEBUG_WORMLET - lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf, 0); + lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf); #else - lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, debugout, 0); + lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, debugout); #endif } @@ -1451,7 +1451,7 @@ static void test_worm_food_collision(void) { collision_count++; } snprintf(buf, sizeof buf, "collisions: %d", collision_count); - lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT -8, buf); lcd_update(); } if (collision_count != FOOD_SIZE) { @@ -1470,7 +1470,7 @@ static void test_worm_food_collision(void) { collision_count ++; } snprintf(buf, sizeof buf, "collisions: %d", collision_count); - lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT -8, buf); lcd_update(); } if (collision_count != FOOD_SIZE * 2) { @@ -1518,7 +1518,7 @@ static void test_worm_argh_collision(void) { collision_count ++; } snprintf(buf, sizeof buf, "collisions: %d", collision_count); - lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT -8, buf); lcd_update(); } if (collision_count != ARGH_SIZE * 2) { @@ -1535,7 +1535,7 @@ static void test_worm_argh_collision(void) { collision_count ++; } snprintf(buf, sizeof buf, "collisions: %d", collision_count); - lcd_putsxy(0, LCD_HEIGHT -8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT -8, buf); lcd_update(); } if (collision_count != ARGH_SIZE * 4) { @@ -1562,7 +1562,7 @@ static int testline_in_rect(void) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); lcd_update(); - lcd_putsxy(0, 0, "failed 1", 0); + lcd_putsxy(0, 0, "failed 1"); button_get(true); testfailed = 1; } @@ -1573,7 +1573,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 2", 0); + lcd_putsxy(0, 0, "failed 2"); lcd_update(); button_get(true); testfailed = 2; @@ -1585,7 +1585,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 3", 0); + lcd_putsxy(0, 0, "failed 3"); lcd_update(); button_get(true); testfailed = 3; @@ -1597,7 +1597,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 4", 0); + lcd_putsxy(0, 0, "failed 4"); lcd_update(); button_get(true); testfailed = 4; @@ -1609,7 +1609,7 @@ static int testline_in_rect(void) { line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 5", 0); + lcd_putsxy(0, 0, "failed 5"); lcd_update(); button_get(true); testfailed = 5; @@ -1622,7 +1622,7 @@ static int testline_in_rect(void) { line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 6", 0); + lcd_putsxy(0, 0, "failed 6"); lcd_update(); button_get(true); testfailed = 6; @@ -1637,7 +1637,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 7", 0); + lcd_putsxy(0, 0, "failed 7"); lcd_update(); button_get(true); testfailed = 7; @@ -1649,7 +1649,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 8", 0); + lcd_putsxy(0, 0, "failed 8"); lcd_update(); button_get(true); testfailed = 8; @@ -1661,7 +1661,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 9", 0); + lcd_putsxy(0, 0, "failed 9"); lcd_update(); button_get(true); testfailed = 9; @@ -1673,7 +1673,7 @@ static int testline_in_rect(void) { !line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 10", 0); + lcd_putsxy(0, 0, "failed 10"); lcd_update(); button_get(true); testfailed = 10; @@ -1685,7 +1685,7 @@ static int testline_in_rect(void) { line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 11", 0); + lcd_putsxy(0, 0, "failed 11"); lcd_update(); button_get(true); testfailed = 11; @@ -1698,7 +1698,7 @@ static int testline_in_rect(void) { line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh)) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 12", 0); + lcd_putsxy(0, 0, "failed 12"); lcd_update(); button_get(true); testfailed = 12; @@ -1715,10 +1715,10 @@ static int testline_in_rect(void) { x2 = 10; y2 = 20; if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && - line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { + line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { lcd_drawrect(rx, ry, rw, rh); lcd_drawline(x1, y1, x2, y2); - lcd_putsxy(0, 0, "failed 13", 0); + lcd_putsxy(0, 0, "failed 13"); lcd_update(); button_get(true); testfailed = 13; @@ -1735,10 +1735,10 @@ static int testline_in_rect(void) { x2 = 10; y2 = 19; if (!(line_in_rect(x1, y1, x2, y2, rx, ry, rw, rh) && - line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { + line_in_rect(x2, y2, x1, y1, rx, ry, rw, rh))) { lcd_drawline(x1, y1, x2, y2); lcd_invertrect(rx, ry, rw, rh); - lcd_putsxy(0, 0, "failed 14", 0); + lcd_putsxy(0, 0, "failed 14"); lcd_update(); button_get(true); testfailed = 14; @@ -1780,7 +1780,7 @@ static int test_specific_worm_collision(void) { } lcd_invertpixel(x + FIELD_RECT_X, y + FIELD_RECT_Y); snprintf(buf, sizeof buf, "collisions %d", collisions); - lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT - 8, buf); lcd_update(); } } @@ -1837,7 +1837,7 @@ static void test_make_argh(void){ } snprintf(buf, sizeof buf, "(%d;%d) fail%d try%d", x, y, failures, tries); - lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT - 8, buf); lcd_update(); lcd_invertrect(x + FIELD_RECT_X, y+ FIELD_RECT_Y, ARGH_SIZE, ARGH_SIZE); lcd_update(); @@ -1875,7 +1875,7 @@ static void test_worm_argh_collision_in_moves(void) { hit_count ++; } snprintf(buf, sizeof buf, "in 5 moves hits: %d", hit_count); - lcd_putsxy(0, LCD_HEIGHT - 8, buf, 0); + lcd_putsxy(0, LCD_HEIGHT - 8, buf); lcd_update(); } if (hit_count != ARGH_SIZE + 5) { |