summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2006-09-02 23:10:28 +0000
committerAntoine Cellerier <dionoea@videolan.org>2006-09-02 23:10:28 +0000
commitdede571a258fb312d58d15424844a933a5f72c02 (patch)
tree4d15ff11bfe9c389e23369a3bb03a1ac81246f83
parentcf605c34349f5519135dc9206df2c049745b16c4 (diff)
downloadrockbox-dede571a258fb312d58d15424844a933a5f72c02.tar.gz
rockbox-dede571a258fb312d58d15424844a933a5f72c02.zip
Some more tweaking so that it now looks really good on small screens
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10862 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/solitaire.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 8d6890db83..c8a7d236a7 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -228,7 +228,7 @@ static struct plugin_api* rb;
228# define CARD_WIDTH 19 228# define CARD_WIDTH 19
229# define CARD_HEIGHT 24 229# define CARD_HEIGHT 24
230#else 230#else
231# define CARD_WIDTH 15 231# define CARD_WIDTH 14
232# define CARD_HEIGHT 12 232# define CARD_HEIGHT 12
233#endif 233#endif
234 234
@@ -429,7 +429,11 @@ 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 draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 ); 433 draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 );
434#else
435 draw_suit( card.suit, x+1+NUMBER_WIDTH, y+1 );
436#endif
433 draw_number( card.num, x+1, y+1 ); 437 draw_number( card.num, x+1, y+1 );
434 } 438 }
435 } 439 }
@@ -1138,7 +1142,8 @@ int solitaire( void )
1138 c = cols[i]; 1142 c = cols[i];
1139 while( c != NOT_A_CARD ) 1143 while( c != NOT_A_CARD )
1140 { 1144 {
1141 j++; 1145 if( deck[c].known ) j += 2;
1146 else j ++;
1142 c = deck[c].next; 1147 c = deck[c].next;
1143 } 1148 }
1144 if( j > biggest_col_length ) biggest_col_length = j; 1149 if( j > biggest_col_length ) biggest_col_length = j;
@@ -1164,12 +1169,12 @@ int solitaire( void )
1164 /* draw the cursor on empty columns */ 1169 /* draw the cursor on empty columns */
1165 if( cur_col == i ) 1170 if( cur_col == i )
1166 { 1171 {
1167 draw_cursor( 1+i*((LCD_WIDTH - 2)/COL_NUM), j+1 ); 1172 draw_cursor( i*((LCD_WIDTH)/COL_NUM), j+1 );
1168 } 1173 }
1169 break; 1174 break;
1170 } 1175 }
1171 1176
1172 draw_card( deck[c], 1+i*((LCD_WIDTH - 2)/COL_NUM), j+1, 1177 draw_card( deck[c], i*((LCD_WIDTH)/COL_NUM), j+1,
1173 c == sel_card, c == cur_card, false ); 1178 c == sel_card, c == cur_card, false );
1174 1179
1175 h = c; 1180 h = c;
@@ -1180,6 +1185,9 @@ int solitaire( void )
1180 * they don't overflow out of the LCD */ 1185 * they don't overflow out of the LCD */
1181 if( h == cur_card ) 1186 if( h == cur_card )
1182 j += SUIT_HEIGHT+2; 1187 j += SUIT_HEIGHT+2;
1188 else if( deck[h].known )
1189 j += min( SUIT_HEIGHT+2,
1190 2*(LCD_HEIGHT - CARD_START - CARD_HEIGHT)/biggest_col_length );
1183 else 1191 else
1184 j += min( SUIT_HEIGHT+2, 1192 j += min( SUIT_HEIGHT+2,
1185 (LCD_HEIGHT - CARD_START - CARD_HEIGHT)/biggest_col_length ); 1193 (LCD_HEIGHT - CARD_START - CARD_HEIGHT)/biggest_col_length );
@@ -1225,11 +1233,7 @@ int solitaire( void )
1225 if( cur_rem != NOT_A_CARD ) 1233 if( cur_rem != NOT_A_CARD )
1226 { 1234 {
1227 prevcard = cur_rem; 1235 prevcard = cur_rem;
1228#if UPPER_ROW_MARGIN > 0
1229 j = CARD_WIDTH+2*UPPER_ROW_MARGIN+1; 1236 j = CARD_WIDTH+2*UPPER_ROW_MARGIN+1;
1230#else
1231 j = CARD_WIDTH/2+2*UPPER_ROW_MARGIN+1;
1232#endif
1233 for( i = 0; i < count_rem; i++ ) 1237 for( i = 0; i < count_rem; i++ )
1234 prevcard = find_prev_card(prevcard); 1238 prevcard = find_prev_card(prevcard);
1235 for( i = 0; i <= count_rem; i++ ) 1239 for( i = 0; i <= count_rem; i++ )