diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp | bin | 582 -> 582 bytes | |||
-rw-r--r-- | apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp | bin | 318 -> 318 bytes | |||
-rw-r--r-- | apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp | bin | 3126 -> 3126 bytes | |||
-rw-r--r-- | apps/plugins/solitaire.c | 41 |
4 files changed, 30 insertions, 11 deletions
diff --git a/apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp b/apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp index 2ba40aa97b..228532b54b 100644 --- a/apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp +++ b/apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp b/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp index 2554f0b349..541bfc0688 100644 --- a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp +++ b/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp b/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp index abf8a334bb..530921db3d 100644 --- a/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp +++ b/apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index d39ddcec14..aeb3de1e63 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c | |||
@@ -209,12 +209,20 @@ static struct plugin_api* rb; | |||
209 | # define CARD_WIDTH 19 | 209 | # define CARD_WIDTH 19 |
210 | # define CARD_HEIGHT 24 | 210 | # define CARD_HEIGHT 24 |
211 | #else | 211 | #else |
212 | # define CARD_WIDTH 14 | 212 | # define CARD_WIDTH 15 |
213 | # define CARD_HEIGHT 10 | 213 | # define CARD_HEIGHT 10 |
214 | #endif | 214 | #endif |
215 | 215 | ||
216 | /* where the cards start */ | 216 | /* where the cards start */ |
217 | #define CARD_START ( CARD_HEIGHT + 4 ) | 217 | #if LCD_HEIGHT > 64 |
218 | # define UPPER_ROW_MARGIN 2 | ||
219 | # define CARD_START ( CARD_HEIGHT + 4 ) | ||
220 | #else | ||
221 | /* The screen is *small* */ | ||
222 | # define UPPER_ROW_MARGIN 0 | ||
223 | # define CARD_START ( CARD_HEIGHT + 1 ) | ||
224 | #endif | ||
225 | |||
218 | 226 | ||
219 | #if LCD_HEIGHT > 64 | 227 | #if LCD_HEIGHT > 64 |
220 | # define NUMBER_HEIGHT 10 | 228 | # define NUMBER_HEIGHT 10 |
@@ -234,7 +242,7 @@ static struct plugin_api* rb; | |||
234 | 242 | ||
235 | #define SUITI_HEIGHT 16 | 243 | #define SUITI_HEIGHT 16 |
236 | #define SUITI_WIDTH 15 | 244 | #define SUITI_WIDTH 15 |
237 | #define SUITI_STRIDE 16 | 245 | #define SUITI_STRIDE 15 |
238 | 246 | ||
239 | 247 | ||
240 | #define draw_number( num, x, y ) \ | 248 | #define draw_number( num, x, y ) \ |
@@ -376,14 +384,20 @@ static void draw_card( card_t card, int x, int y, | |||
376 | rb->lcd_set_foreground( LCD_WHITE ); | 384 | rb->lcd_set_foreground( LCD_WHITE ); |
377 | rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 ); | 385 | rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 ); |
378 | #endif | 386 | #endif |
379 | draw_number( card.num, x+1, y+1 ); | ||
380 | if( leftstyle ) | 387 | if( leftstyle ) |
381 | { | 388 | { |
389 | #if UPPER_ROW_MARGIN > 0 | ||
382 | draw_suit( card.suit, x+1, y+2+NUMBER_HEIGHT ); | 390 | draw_suit( card.suit, x+1, y+2+NUMBER_HEIGHT ); |
391 | draw_number( card.num, x+1, y+1 ); | ||
392 | #else | ||
393 | draw_suit( card.suit, x+1, y+NUMBER_HEIGHT-1 ); | ||
394 | draw_number( card.num, x+1, y-1 ); | ||
395 | #endif | ||
383 | } | 396 | } |
384 | else | 397 | else |
385 | { | 398 | { |
386 | draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 ); | 399 | draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 ); |
400 | draw_number( card.num, x+1, y+1 ); | ||
387 | } | 401 | } |
388 | } | 402 | } |
389 | #ifdef HAVE_LCD_COLOR | 403 | #ifdef HAVE_LCD_COLOR |
@@ -1149,13 +1163,15 @@ int solitaire( void ) | |||
1149 | if( c != NOT_A_CARD ) | 1163 | if( c != NOT_A_CARD ) |
1150 | { | 1164 | { |
1151 | draw_card( deck[c], | 1165 | draw_card( deck[c], |
1152 | LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, 2, | 1166 | LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, |
1167 | UPPER_ROW_MARGIN, | ||
1153 | c == sel_card, cur_col == STACKS_COL + i, false ); | 1168 | c == sel_card, cur_col == STACKS_COL + i, false ); |
1154 | } | 1169 | } |
1155 | else | 1170 | else |
1156 | { | 1171 | { |
1157 | draw_empty_stack( i, | 1172 | draw_empty_stack( i, |
1158 | LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, 2, | 1173 | LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, |
1174 | UPPER_ROW_MARGIN, | ||
1159 | cur_col == STACKS_COL + i ); | 1175 | cur_col == STACKS_COL + i ); |
1160 | } | 1176 | } |
1161 | } | 1177 | } |
@@ -1174,16 +1190,18 @@ int solitaire( void ) | |||
1174 | prevcard = find_prev_card(prevcard); | 1190 | prevcard = find_prev_card(prevcard); |
1175 | for( i = 0; i <= coun_rem; i++ ) | 1191 | for( i = 0; i <= coun_rem; i++ ) |
1176 | { | 1192 | { |
1177 | draw_card( deck[prevcard], CARD_WIDTH+4+j+1, 2, | 1193 | draw_card( deck[prevcard], |
1178 | sel_card == prevcard, cur_card == prevcard, | 1194 | CARD_WIDTH+2*UPPER_ROW_MARGIN+j+1, |
1179 | i < coun_rem ); | 1195 | UPPER_ROW_MARGIN, sel_card == prevcard, |
1196 | cur_card == prevcard, i < coun_rem ); | ||
1180 | prevcard = deck[prevcard].next; | 1197 | prevcard = deck[prevcard].next; |
1181 | j += NUMBER_WIDTH+2; | 1198 | j += NUMBER_WIDTH+2; |
1182 | } | 1199 | } |
1183 | } | 1200 | } |
1184 | else if( cur_rem == NOT_A_CARD && cur_col == REM_COL ) | 1201 | else if( cur_rem == NOT_A_CARD && cur_col == REM_COL ) |
1185 | { | 1202 | { |
1186 | draw_cursor( CARD_WIDTH+4+1, 2 ); | 1203 | draw_cursor( CARD_WIDTH+2*UPPER_ROW_MARGIN+1, |
1204 | UPPER_ROW_MARGIN ); | ||
1187 | } | 1205 | } |
1188 | } | 1206 | } |
1189 | 1207 | ||
@@ -1192,7 +1210,8 @@ int solitaire( void ) | |||
1192 | { | 1210 | { |
1193 | /* gruik ! (we want to display a card back) */ | 1211 | /* gruik ! (we want to display a card back) */ |
1194 | deck[rem].known = false; | 1212 | deck[rem].known = false; |
1195 | draw_card( deck[rem], 2, 2, false, false, false ); | 1213 | draw_card( deck[rem], UPPER_ROW_MARGIN, UPPER_ROW_MARGIN, |
1214 | false, false, false ); | ||
1196 | deck[rem].known = true; | 1215 | deck[rem].known = true; |
1197 | } | 1216 | } |
1198 | 1217 | ||