forked from len0rd/rockbox
Changed the lcd_drawrect() api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2038 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
513044fe58
commit
aad11165dc
2 changed files with 9 additions and 14 deletions
|
|
@ -38,14 +38,11 @@
|
||||||
static void ss_loop(void)
|
static void ss_loop(void)
|
||||||
{
|
{
|
||||||
int b;
|
int b;
|
||||||
int x2 = LCD_WIDTH/2;
|
|
||||||
int y2 = LCD_HEIGHT/2;
|
|
||||||
int x = LCD_WIDTH/2;
|
int x = LCD_WIDTH/2;
|
||||||
int y = LCD_HEIGHT/2;
|
int y = LCD_HEIGHT/2;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int center = 0;
|
int center = 0;
|
||||||
int factor = 0;
|
int factor = 0;
|
||||||
int offset = 0;
|
|
||||||
|
|
||||||
if (LCD_HEIGHT < LCD_WIDTH)
|
if (LCD_HEIGHT < LCD_WIDTH)
|
||||||
center = LCD_HEIGHT/2;
|
center = LCD_HEIGHT/2;
|
||||||
|
|
@ -67,14 +64,12 @@ static void ss_loop(void)
|
||||||
i = center;
|
i = center;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset=i*factor;
|
|
||||||
|
|
||||||
b = button_get(false);
|
b = button_get(false);
|
||||||
if ( b & BUTTON_OFF )
|
if ( b & BUTTON_OFF )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lcd_clear_display();
|
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();
|
lcd_update();
|
||||||
|
|
||||||
i+=factor;
|
i+=factor;
|
||||||
|
|
|
||||||
|
|
@ -931,8 +931,8 @@ void update_screen(void) {
|
||||||
for (c=0 ; c<20 ; c++) {
|
for (c=0 ; c<20 ; c++) {
|
||||||
switch ( board[b][c] ) {
|
switch ( board[b][c] ) {
|
||||||
case 0: /* this is a black space */
|
case 0: /* this is a black space */
|
||||||
lcd_drawrect (c*4, b*4, c*4+3, b*4+3);
|
lcd_drawrect (c*4, b*4, 4, 4);
|
||||||
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;
|
break;
|
||||||
|
|
||||||
case 2: /* this is a wall */
|
case 2: /* this is a wall */
|
||||||
|
|
@ -947,11 +947,11 @@ void update_screen(void) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: /* this is a home location */
|
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;
|
break;
|
||||||
|
|
||||||
case 4: /* this is a box */
|
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;
|
break;
|
||||||
|
|
||||||
case 5: /* this is you */
|
case 5: /* this is you */
|
||||||
|
|
@ -963,8 +963,8 @@ void update_screen(void) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7: /* this is a box on a home spot */
|
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, b*4, 4, 4);
|
||||||
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -976,8 +976,8 @@ void update_screen(void) {
|
||||||
snprintf (s, sizeof(s), "%d", moves);
|
snprintf (s, sizeof(s), "%d", moves);
|
||||||
lcd_putsxy (86, 54, s, 0);
|
lcd_putsxy (86, 54, s, 0);
|
||||||
|
|
||||||
lcd_drawrect (80,0,111,31);
|
lcd_drawrect (80,0,32,32);
|
||||||
lcd_drawrect (80,32,111,63);
|
lcd_drawrect (80,32,32,64);
|
||||||
lcd_putsxy (81, 10, "Level", 0);
|
lcd_putsxy (81, 10, "Level", 0);
|
||||||
lcd_putsxy (81, 42, "Moves", 0);
|
lcd_putsxy (81, 42, "Moves", 0);
|
||||||
/* print out the screen */
|
/* print out the screen */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue