diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2006-09-03 14:16:03 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2006-09-03 14:16:03 +0000 |
commit | cfae9238b50ddff5bcb3d20bbbac2164ca29f1e9 (patch) | |
tree | aed7d209cc16b80f248f7cd2268bfdc24dd271a7 /apps/plugins | |
parent | b460fdafa8ffe81ff3e3b126374c889413d8b8ce (diff) | |
download | rockbox-cfae9238b50ddff5bcb3d20bbbac2164ca29f1e9.tar.gz rockbox-cfae9238b50ddff5bcb3d20bbbac2164ca29f1e9.zip |
Use consistant margins. If people still have ideas to make it look better on some of the targets, feel free to say so on IRC.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10868 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/solitaire.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index c8a7d236a7..1c4746f7dc 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c | |||
@@ -234,11 +234,11 @@ static struct plugin_api* rb; | |||
234 | 234 | ||
235 | /* where the cards start */ | 235 | /* where the cards start */ |
236 | #if LCD_HEIGHT > 64 | 236 | #if LCD_HEIGHT > 64 |
237 | # define UPPER_ROW_MARGIN 2 | 237 | # define MARGIN 2 |
238 | # define CARD_START ( CARD_HEIGHT + 4 ) | 238 | # define CARD_START ( CARD_HEIGHT + 4 ) |
239 | #else | 239 | #else |
240 | /* The screen is *small* */ | 240 | /* The screen is *small* */ |
241 | # define UPPER_ROW_MARGIN 0 | 241 | # define MARGIN 0 |
242 | # define CARD_START ( CARD_HEIGHT + 1 ) | 242 | # define CARD_START ( CARD_HEIGHT + 1 ) |
243 | #endif | 243 | #endif |
244 | 244 | ||
@@ -419,7 +419,7 @@ static void draw_card( card_t card, int x, int y, | |||
419 | #endif | 419 | #endif |
420 | if( leftstyle ) | 420 | if( leftstyle ) |
421 | { | 421 | { |
422 | #if UPPER_ROW_MARGIN > 0 | 422 | #if MARGIN > 0 |
423 | draw_suit( card.suit, x+1, y+2+NUMBER_HEIGHT ); | 423 | draw_suit( card.suit, x+1, y+2+NUMBER_HEIGHT ); |
424 | draw_number( card.num, x+1, y+1 ); | 424 | draw_number( card.num, x+1, y+1 ); |
425 | #else | 425 | #else |
@@ -429,7 +429,7 @@ static void draw_card( card_t card, int x, int y, | |||
429 | } | 429 | } |
430 | else | 430 | else |
431 | { | 431 | { |
432 | #if UPPER_ROW_MARGIN > 0 | 432 | #if MARGIN > 0 |
433 | draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 ); | 433 | draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 ); |
434 | #else | 434 | #else |
435 | draw_suit( card.suit, x+1+NUMBER_WIDTH, y+1 ); | 435 | draw_suit( card.suit, x+1+NUMBER_WIDTH, y+1 ); |
@@ -1169,13 +1169,14 @@ int solitaire( void ) | |||
1169 | /* draw the cursor on empty columns */ | 1169 | /* draw the cursor on empty columns */ |
1170 | if( cur_col == i ) | 1170 | if( cur_col == i ) |
1171 | { | 1171 | { |
1172 | draw_cursor( i*((LCD_WIDTH)/COL_NUM), j+1 ); | 1172 | draw_cursor( MARGIN+i*((LCD_WIDTH-2*MARGIN)/COL_NUM), |
1173 | j+1 ); | ||
1173 | } | 1174 | } |
1174 | break; | 1175 | break; |
1175 | } | 1176 | } |
1176 | 1177 | ||
1177 | draw_card( deck[c], i*((LCD_WIDTH)/COL_NUM), j+1, | 1178 | draw_card( deck[c], MARGIN+i*((LCD_WIDTH-2*MARGIN)/COL_NUM), |
1178 | c == sel_card, c == cur_card, false ); | 1179 | j+1, c == sel_card, c == cur_card, false ); |
1179 | 1180 | ||
1180 | h = c; | 1181 | h = c; |
1181 | c = deck[c].next; | 1182 | c = deck[c].next; |
@@ -1202,16 +1203,15 @@ int solitaire( void ) | |||
1202 | if( c != NOT_A_CARD ) | 1203 | if( c != NOT_A_CARD ) |
1203 | { | 1204 | { |
1204 | draw_card( deck[c], | 1205 | draw_card( deck[c], |
1205 | LCD_WIDTH - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, | 1206 | LCD_WIDTH-(CARD_WIDTH*4+8+MARGIN)+CARD_WIDTH*i+i*2+1, |
1206 | UPPER_ROW_MARGIN, | 1207 | MARGIN, |
1207 | c == sel_card, cur_col == STACKS_COL + i, false ); | 1208 | c == sel_card, cur_col == STACKS_COL + i, false ); |
1208 | } | 1209 | } |
1209 | else | 1210 | else |
1210 | { | 1211 | { |
1211 | draw_empty_stack( i, | 1212 | draw_empty_stack( i, |
1212 | LCD_WIDTH - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, | 1213 | LCD_WIDTH-(CARD_WIDTH*4+8+MARGIN)+CARD_WIDTH*i+i*2+1, |
1213 | UPPER_ROW_MARGIN, | 1214 | MARGIN, cur_col == STACKS_COL + i ); |
1214 | cur_col == STACKS_COL + i ); | ||
1215 | } | 1215 | } |
1216 | } | 1216 | } |
1217 | 1217 | ||
@@ -1221,8 +1221,7 @@ int solitaire( void ) | |||
1221 | { | 1221 | { |
1222 | /* gruik ! (we want to display a card back) */ | 1222 | /* gruik ! (we want to display a card back) */ |
1223 | deck[rem].known = false; | 1223 | deck[rem].known = false; |
1224 | draw_card( deck[rem], UPPER_ROW_MARGIN, UPPER_ROW_MARGIN, | 1224 | draw_card( deck[rem], MARGIN, MARGIN, false, false, false ); |
1225 | false, false, false ); | ||
1226 | deck[rem].known = true; | 1225 | deck[rem].known = true; |
1227 | } | 1226 | } |
1228 | 1227 | ||
@@ -1233,13 +1232,13 @@ int solitaire( void ) | |||
1233 | if( cur_rem != NOT_A_CARD ) | 1232 | if( cur_rem != NOT_A_CARD ) |
1234 | { | 1233 | { |
1235 | prevcard = cur_rem; | 1234 | prevcard = cur_rem; |
1236 | j = CARD_WIDTH+2*UPPER_ROW_MARGIN+1; | 1235 | j = CARD_WIDTH+2*MARGIN+1; |
1237 | for( i = 0; i < count_rem; i++ ) | 1236 | for( i = 0; i < count_rem; i++ ) |
1238 | prevcard = find_prev_card(prevcard); | 1237 | prevcard = find_prev_card(prevcard); |
1239 | for( i = 0; i <= count_rem; i++ ) | 1238 | for( i = 0; i <= count_rem; i++ ) |
1240 | { | 1239 | { |
1241 | draw_card( deck[prevcard], j, | 1240 | draw_card( deck[prevcard], j, |
1242 | UPPER_ROW_MARGIN, sel_card == prevcard, | 1241 | MARGIN, sel_card == prevcard, |
1243 | cur_card == prevcard, i < count_rem ); | 1242 | cur_card == prevcard, i < count_rem ); |
1244 | prevcard = deck[prevcard].next; | 1243 | prevcard = deck[prevcard].next; |
1245 | j += NUMBER_WIDTH+2; | 1244 | j += NUMBER_WIDTH+2; |
@@ -1247,8 +1246,7 @@ int solitaire( void ) | |||
1247 | } | 1246 | } |
1248 | else if( cur_rem == NOT_A_CARD && cur_col == REM_COL ) | 1247 | else if( cur_rem == NOT_A_CARD && cur_col == REM_COL ) |
1249 | { | 1248 | { |
1250 | draw_cursor( CARD_WIDTH+2*UPPER_ROW_MARGIN+1, | 1249 | draw_cursor( CARD_WIDTH+2*MARGIN+1, MARGIN ); |
1251 | UPPER_ROW_MARGIN ); | ||
1252 | } | 1250 | } |
1253 | } | 1251 | } |
1254 | 1252 | ||