summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2006-08-03 19:57:33 +0000
committerAntoine Cellerier <dionoea@videolan.org>2006-08-03 19:57:33 +0000
commit312ccc2f2ff6921a37addfe1ad7afd4588123d7d (patch)
tree4d521c251f8ce20a0fdcdac5ef50ef6b53f9faf6 /apps/plugins
parent9be442369155aa31fb34fa6c7a4f314f1426aa14 (diff)
downloadrockbox-312ccc2f2ff6921a37addfe1ad7afd4588123d7d.zip
rockbox-312ccc2f2ff6921a37addfe1ad7afd4588123d7d.tar.gz
rockbox-312ccc2f2ff6921a37addfe1ad7afd4588123d7d.tar.bz2
rockbox-312ccc2f2ff6921a37addfe1ad7afd4588123d7d.tar.xz
Some graphics fixes for solitaire. (Numbers for hearts and diamonds still need to be colored red on color LCD screens)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10443 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/bitmaps/native/solitaire_numbers.8x10x1.bmpbin582 -> 582 bytes
-rw-r--r--apps/plugins/bitmaps/native/solitaire_suitsi.15x16x1.bmpbin318 -> 318 bytes
-rw-r--r--apps/plugins/bitmaps/native/solitaire_suitsi.15x16x16.bmpbin3126 -> 3126 bytes
-rw-r--r--apps/plugins/solitaire.c41
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 2ba40aa..228532b 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 2554f0b..541bfc0 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 abf8a33..530921d 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 d39ddce..aeb3de1 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -209,12 +209,20 @@ static struct plugin_api* rb;
# define CARD_WIDTH 19
# define CARD_HEIGHT 24
#else
-# define CARD_WIDTH 14
+# define CARD_WIDTH 15
# define CARD_HEIGHT 10
#endif
/* where the cards start */
-#define CARD_START ( CARD_HEIGHT + 4 )
+#if LCD_HEIGHT > 64
+# define UPPER_ROW_MARGIN 2
+# define CARD_START ( CARD_HEIGHT + 4 )
+#else
+ /* The screen is *small* */
+# define UPPER_ROW_MARGIN 0
+# define CARD_START ( CARD_HEIGHT + 1 )
+#endif
+
#if LCD_HEIGHT > 64
# define NUMBER_HEIGHT 10
@@ -234,7 +242,7 @@ static struct plugin_api* rb;
#define SUITI_HEIGHT 16
#define SUITI_WIDTH 15
-#define SUITI_STRIDE 16
+#define SUITI_STRIDE 15
#define draw_number( num, x, y ) \
@@ -376,14 +384,20 @@ static void draw_card( card_t card, int x, int y,
rb->lcd_set_foreground( LCD_WHITE );
rb->lcd_fillrect( x+1, y+1, CARD_WIDTH-1, CARD_HEIGHT-1 );
#endif
- draw_number( card.num, x+1, y+1 );
if( leftstyle )
{
+#if UPPER_ROW_MARGIN > 0
draw_suit( card.suit, x+1, y+2+NUMBER_HEIGHT );
+ draw_number( card.num, x+1, y+1 );
+#else
+ draw_suit( card.suit, x+1, y+NUMBER_HEIGHT-1 );
+ draw_number( card.num, x+1, y-1 );
+#endif
}
else
{
draw_suit( card.suit, x+2+NUMBER_WIDTH, y+1 );
+ draw_number( card.num, x+1, y+1 );
}
}
#ifdef HAVE_LCD_COLOR
@@ -1149,13 +1163,15 @@ int solitaire( void )
if( c != NOT_A_CARD )
{
draw_card( deck[c],
- LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, 2,
+ LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1,
+ UPPER_ROW_MARGIN,
c == sel_card, cur_col == STACKS_COL + i, false );
}
else
{
draw_empty_stack( i,
- LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1, 2,
+ LCD_WIDTH2 - (CARD_WIDTH*4+8)+CARD_WIDTH*i+i*2+1,
+ UPPER_ROW_MARGIN,
cur_col == STACKS_COL + i );
}
}
@@ -1174,16 +1190,18 @@ int solitaire( void )
prevcard = find_prev_card(prevcard);
for( i = 0; i <= coun_rem; i++ )
{
- draw_card( deck[prevcard], CARD_WIDTH+4+j+1, 2,
- sel_card == prevcard, cur_card == prevcard,
- i < coun_rem );
+ draw_card( deck[prevcard],
+ CARD_WIDTH+2*UPPER_ROW_MARGIN+j+1,
+ UPPER_ROW_MARGIN, sel_card == prevcard,
+ cur_card == prevcard, i < coun_rem );
prevcard = deck[prevcard].next;
j += NUMBER_WIDTH+2;
}
}
else if( cur_rem == NOT_A_CARD && cur_col == REM_COL )
{
- draw_cursor( CARD_WIDTH+4+1, 2 );
+ draw_cursor( CARD_WIDTH+2*UPPER_ROW_MARGIN+1,
+ UPPER_ROW_MARGIN );
}
}
@@ -1192,7 +1210,8 @@ int solitaire( void )
{
/* gruik ! (we want to display a card back) */
deck[rem].known = false;
- draw_card( deck[rem], 2, 2, false, false, false );
+ draw_card( deck[rem], UPPER_ROW_MARGIN, UPPER_ROW_MARGIN,
+ false, false, false );
deck[rem].known = true;
}