summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2006-06-10 22:43:38 +0000
committerAntoine Cellerier <dionoea@videolan.org>2006-06-10 22:43:38 +0000
commit101638f831fef1136382d4196018a9de0a555d40 (patch)
treecb1ca2c3da4f7de3010f0ddafedd2d072aeb4e28 /apps
parent27762e123cb0672f931d5b622d96fef6b55b2dfd (diff)
downloadrockbox-101638f831fef1136382d4196018a9de0a555d40.zip
rockbox-101638f831fef1136382d4196018a9de0a555d40.tar.gz
rockbox-101638f831fef1136382d4196018a9de0a555d40.tar.bz2
rockbox-101638f831fef1136382d4196018a9de0a555d40.tar.xz
Flipit grayscale bitmaps for native grayscale LCDs
(tested simulators: h1x0, ipod mini and ipod 4g) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10106 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/bitmaps/native/SOURCES6
-rw-r--r--apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmpbin0 -> 3654 bytes
-rw-r--r--apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmpbin0 -> 8334 bytes
-rw-r--r--apps/plugins/flipit.c35
4 files changed, 37 insertions, 4 deletions
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 5c30ce6..6b37436 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -127,6 +127,12 @@ flipit_tokens.40x40.bmp
#else
flipit_tokens.30x30.bmp
#endif
+#elif LCD_DEPTH >= 2
+#if LCD_WIDTH >= 150
+flipit_tokens.30x30x2.bmp
+#else
+flipit_tokens.20x20x2.bmp
+#endif
#endif
/* Star */
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp b/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp
new file mode 100644
index 0000000..5dbae76
--- /dev/null
+++ b/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp b/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp
new file mode 100644
index 0000000..63262b5
--- /dev/null
+++ b/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp
Binary files differ
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 909fbda..164949b 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -94,6 +94,8 @@ static int toggle[20];
static int cursor_pos, moves;
static char s[5];
+#if LCD_DEPTH >= 2
+
#ifdef HAVE_LCD_COLOR
#if LCD_HEIGHT >= 200
@@ -104,6 +106,16 @@ static char s[5];
#define tksize 30
#endif
+#else
+
+#if LCD_WIDTH >= 150
+#define tksize 30
+#else
+#define tksize 20
+#endif
+
+#endif
+
extern const fb_data flipit_tokens[];
#else
@@ -145,7 +157,7 @@ static unsigned char cursor_pic[32] = {
/* draw a spot at the coordinates (x,y), range of p is 0-19 */
static void draw_spot(int p) {
-#if HAVE_LCD_COLOR
+#if LCD_DEPTH >= 2
rb->lcd_bitmap_part( flipit_tokens, 0, spots[p]*tksize, tksize,
(p%5)*tksize+GRID_LEFT, (p/5)*tksize+GRID_TOP,
tksize, tksize );
@@ -159,11 +171,26 @@ static void draw_spot(int p) {
/* draw the cursor at the current cursor position */
static void draw_cursor(void) {
-#if HAVE_LCD_COLOR
+
+#ifdef HAVE_LCD_COLOR
rb->lcd_bitmap_transparent_part( flipit_tokens, 0, 2*tksize, tksize,
(cursor_pos%5)*tksize+GRID_LEFT,
(cursor_pos/5)*tksize+GRID_TOP,
tksize, tksize );
+#elif LCD_DEPTH >= 2
+/* grayscale doesn't have transparent bitmap ... */
+ int i,j;
+ i = ( cursor_pos%5 )*tksize;
+ j = ( cursor_pos/5 )*tksize;
+ rb->lcd_set_drawmode( DRMODE_SOLID );
+ rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP,
+ i+tksize-1+GRID_LEFT, j+GRID_TOP );
+ rb->lcd_drawline( i+GRID_LEFT, j+tksize-1+GRID_TOP,
+ i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP );
+ rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP,
+ i+GRID_LEFT, j+tksize-1+GRID_TOP );
+ rb->lcd_drawline( i+tksize-1+GRID_LEFT, j+GRID_TOP,
+ i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP );
#else
int i,j;
i = (cursor_pos%5)*16;
@@ -179,7 +206,7 @@ static void draw_cursor(void) {
/* clear the cursor where it is */
static void clear_cursor(void) {
-#if HAVE_LCD_COLOR
+#if LCD_DEPTH >= 2
draw_spot( cursor_pos );
#else
int i,j;
@@ -355,7 +382,7 @@ static bool flipit_loop(void) {
/* toggle the pieces */
if (!flipit_finished()) {
flipit_toggle();
-#ifdef HAVE_LCD_COLOR
+#if LCD_DEPTH >= 2
draw_cursor();
#endif
rb->lcd_update();