diff options
author | Markus Braun <markus.braun@krawel.de> | 2002-08-28 14:22:40 +0000 |
---|---|---|
committer | Markus Braun <markus.braun@krawel.de> | 2002-08-28 14:22:40 +0000 |
commit | aad11165dca1d80bdf4ef88cf38a60f68430ac50 (patch) | |
tree | b435692433341cf879374786ce9478786b68c2bc | |
parent | 513044fe58db65732961650e8161c174a1bab0db (diff) | |
download | rockbox-aad11165dca1d80bdf4ef88cf38a60f68430ac50.tar.gz rockbox-aad11165dca1d80bdf4ef88cf38a60f68430ac50.zip |
Changed the lcd_drawrect() api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2038 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/recorder/boxes.c | 7 | ||||
-rw-r--r-- | apps/recorder/sokoban.c | 16 |
2 files changed, 9 insertions, 14 deletions
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 @@ | |||
38 | static void ss_loop(void) | 38 | static void ss_loop(void) |
39 | { | 39 | { |
40 | int b; | 40 | int b; |
41 | int x2 = LCD_WIDTH/2; | ||
42 | int y2 = LCD_HEIGHT/2; | ||
43 | int x = LCD_WIDTH/2; | 41 | int x = LCD_WIDTH/2; |
44 | int y = LCD_HEIGHT/2; | 42 | int y = LCD_HEIGHT/2; |
45 | int i = 0; | 43 | int i = 0; |
46 | int center = 0; | 44 | int center = 0; |
47 | int factor = 0; | 45 | int factor = 0; |
48 | int offset = 0; | ||
49 | 46 | ||
50 | if (LCD_HEIGHT < LCD_WIDTH) | 47 | if (LCD_HEIGHT < LCD_WIDTH) |
51 | center = LCD_HEIGHT/2; | 48 | center = LCD_HEIGHT/2; |
@@ -67,14 +64,12 @@ static void ss_loop(void) | |||
67 | i = center; | 64 | i = center; |
68 | } | 65 | } |
69 | 66 | ||
70 | offset=i*factor; | ||
71 | |||
72 | b = button_get(false); | 67 | b = button_get(false); |
73 | if ( b & BUTTON_OFF ) | 68 | if ( b & BUTTON_OFF ) |
74 | return; | 69 | return; |
75 | 70 | ||
76 | lcd_clear_display(); | 71 | lcd_clear_display(); |
77 | lcd_drawrect(x-offset, y-offset, x2+offset, y2+offset); | 72 | lcd_drawrect(x-i, y-i, 2*i+1, 2*i+1); |
78 | lcd_update(); | 73 | lcd_update(); |
79 | 74 | ||
80 | i+=factor; | 75 | 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) { | |||
931 | for (c=0 ; c<20 ; c++) { | 931 | for (c=0 ; c<20 ; c++) { |
932 | switch ( board[b][c] ) { | 932 | switch ( board[b][c] ) { |
933 | case 0: /* this is a black space */ | 933 | case 0: /* this is a black space */ |
934 | lcd_drawrect (c*4, b*4, c*4+3, b*4+3); | 934 | lcd_drawrect (c*4, b*4, 4, 4); |
935 | lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); | 935 | lcd_drawrect (c*4+1, b*4+1, 2, 2); |
936 | break; | 936 | break; |
937 | 937 | ||
938 | case 2: /* this is a wall */ | 938 | case 2: /* this is a wall */ |
@@ -947,11 +947,11 @@ void update_screen(void) { | |||
947 | break; | 947 | break; |
948 | 948 | ||
949 | case 3: /* this is a home location */ | 949 | case 3: /* this is a home location */ |
950 | lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); | 950 | lcd_drawrect (c*4+1, b*4+1, 2, 2); |
951 | break; | 951 | break; |
952 | 952 | ||
953 | case 4: /* this is a box */ | 953 | case 4: /* this is a box */ |
954 | lcd_drawrect (c*4, b*4, c*4+3, b*4+3); | 954 | lcd_drawrect (c*4, b*4, 4, 4); |
955 | break; | 955 | break; |
956 | 956 | ||
957 | case 5: /* this is you */ | 957 | case 5: /* this is you */ |
@@ -963,8 +963,8 @@ void update_screen(void) { | |||
963 | break; | 963 | break; |
964 | 964 | ||
965 | case 7: /* this is a box on a home spot */ | 965 | case 7: /* this is a box on a home spot */ |
966 | lcd_drawrect (c*4, b*4, c*4+3, b*4+3); | 966 | lcd_drawrect (c*4, b*4, 4, 4); |
967 | lcd_drawrect (c*4+1, b*4+1, c*4+2, b*4+2); | 967 | lcd_drawrect (c*4+1, b*4+1, 2, 2); |
968 | break; | 968 | break; |
969 | } | 969 | } |
970 | } | 970 | } |
@@ -976,8 +976,8 @@ void update_screen(void) { | |||
976 | snprintf (s, sizeof(s), "%d", moves); | 976 | snprintf (s, sizeof(s), "%d", moves); |
977 | lcd_putsxy (86, 54, s, 0); | 977 | lcd_putsxy (86, 54, s, 0); |
978 | 978 | ||
979 | lcd_drawrect (80,0,111,31); | 979 | lcd_drawrect (80,0,32,32); |
980 | lcd_drawrect (80,32,111,63); | 980 | lcd_drawrect (80,32,32,64); |
981 | lcd_putsxy (81, 10, "Level", 0); | 981 | lcd_putsxy (81, 10, "Level", 0); |
982 | lcd_putsxy (81, 42, "Moves", 0); | 982 | lcd_putsxy (81, 42, "Moves", 0); |
983 | /* print out the screen */ | 983 | /* print out the screen */ |