From aad11165dca1d80bdf4ef88cf38a60f68430ac50 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Wed, 28 Aug 2002 14:22:40 +0000 Subject: Changed the lcd_drawrect() api. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2038 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/boxes.c | 7 +------ apps/recorder/sokoban.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'apps') diff --git a/apps/recorder/boxes.c b/apps/recorder/boxes.c index 60fdef6f9b..9c38cd4e83 100644 --- a/apps/recorder/boxes.c +++ b/apps/recorder/boxes.c @@ -38,14 +38,11 @@ static void ss_loop(void) { int b; - int x2 = LCD_WIDTH/2; - int y2 = LCD_HEIGHT/2; int x = LCD_WIDTH/2; int y = LCD_HEIGHT/2; int i = 0; int center = 0; int factor = 0; - int offset = 0; if (LCD_HEIGHT < LCD_WIDTH) center = LCD_HEIGHT/2; @@ -67,14 +64,12 @@ static void ss_loop(void) i = center; } - offset=i*factor; - b = button_get(false); if ( b & BUTTON_OFF ) return; lcd_clear_display(); - lcd_drawrect(x-offset, y-offset, x2+offset, y2+offset); + lcd_drawrect(x-i, y-i, 2*i+1, 2*i+1); lcd_update(); i+=factor; diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c index 6ce19e6a41..6947180ec9 100644 --- a/apps/recorder/sokoban.c +++ b/apps/recorder/sokoban.c @@ -931,8 +931,8 @@ void update_screen(void) { for (c=0 ; c<20 ; c++) { switch ( board[b][c] ) { case 0: /* this is a black space */ - lcd_drawrect (c*4, b*4, c*4+3, b*4+3); - lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); + lcd_drawrect (c*4, b*4, 4, 4); + lcd_drawrect (c*4+1, b*4+1, 2, 2); break; case 2: /* this is a wall */ @@ -947,11 +947,11 @@ void update_screen(void) { break; case 3: /* this is a home location */ - lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); + lcd_drawrect (c*4+1, b*4+1, 2, 2); break; case 4: /* this is a box */ - lcd_drawrect (c*4, b*4, c*4+3, b*4+3); + lcd_drawrect (c*4, b*4, 4, 4); break; case 5: /* this is you */ @@ -963,8 +963,8 @@ void update_screen(void) { break; case 7: /* this is a box on a home spot */ - lcd_drawrect (c*4, b*4, c*4+3, b*4+3); - lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); + lcd_drawrect (c*4, b*4, 4, 4); + lcd_drawrect (c*4+1, b*4+1, 2, 2); break; } } @@ -976,8 +976,8 @@ void update_screen(void) { snprintf (s, sizeof(s), "%d", moves); lcd_putsxy (86, 54, s, 0); - lcd_drawrect (80,0,111,31); - lcd_drawrect (80,32,111,63); + lcd_drawrect (80,0,32,32); + lcd_drawrect (80,32,32,64); lcd_putsxy (81, 10, "Level", 0); lcd_putsxy (81, 42, "Moves", 0); /* print out the screen */ -- cgit v1.2.3