summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 5c30ce607e..6b37436e02 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -127,6 +127,12 @@ flipit_tokens.40x40.bmp
127#else 127#else
128flipit_tokens.30x30.bmp 128flipit_tokens.30x30.bmp
129#endif 129#endif
130#elif LCD_DEPTH >= 2
131#if LCD_WIDTH >= 150
132flipit_tokens.30x30x2.bmp
133#else
134flipit_tokens.20x20x2.bmp
135#endif
130#endif 136#endif
131 137
132/* Star */ 138/* 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 0000000000..5dbae762c9
--- /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 0000000000..63262b5f65
--- /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 909fbda06a..164949b6dd 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -94,6 +94,8 @@ static int toggle[20];
94static int cursor_pos, moves; 94static int cursor_pos, moves;
95static char s[5]; 95static char s[5];
96 96
97#if LCD_DEPTH >= 2
98
97#ifdef HAVE_LCD_COLOR 99#ifdef HAVE_LCD_COLOR
98 100
99#if LCD_HEIGHT >= 200 101#if LCD_HEIGHT >= 200
@@ -104,6 +106,16 @@ static char s[5];
104#define tksize 30 106#define tksize 30
105#endif 107#endif
106 108
109#else
110
111#if LCD_WIDTH >= 150
112#define tksize 30
113#else
114#define tksize 20
115#endif
116
117#endif
118
107extern const fb_data flipit_tokens[]; 119extern const fb_data flipit_tokens[];
108 120
109#else 121#else
@@ -145,7 +157,7 @@ static unsigned char cursor_pic[32] = {
145 157
146/* draw a spot at the coordinates (x,y), range of p is 0-19 */ 158/* draw a spot at the coordinates (x,y), range of p is 0-19 */
147static void draw_spot(int p) { 159static void draw_spot(int p) {
148#if HAVE_LCD_COLOR 160#if LCD_DEPTH >= 2
149 rb->lcd_bitmap_part( flipit_tokens, 0, spots[p]*tksize, tksize, 161 rb->lcd_bitmap_part( flipit_tokens, 0, spots[p]*tksize, tksize,
150 (p%5)*tksize+GRID_LEFT, (p/5)*tksize+GRID_TOP, 162 (p%5)*tksize+GRID_LEFT, (p/5)*tksize+GRID_TOP,
151 tksize, tksize ); 163 tksize, tksize );
@@ -159,11 +171,26 @@ static void draw_spot(int p) {
159 171
160/* draw the cursor at the current cursor position */ 172/* draw the cursor at the current cursor position */
161static void draw_cursor(void) { 173static void draw_cursor(void) {
162#if HAVE_LCD_COLOR 174
175#ifdef HAVE_LCD_COLOR
163 rb->lcd_bitmap_transparent_part( flipit_tokens, 0, 2*tksize, tksize, 176 rb->lcd_bitmap_transparent_part( flipit_tokens, 0, 2*tksize, tksize,
164 (cursor_pos%5)*tksize+GRID_LEFT, 177 (cursor_pos%5)*tksize+GRID_LEFT,
165 (cursor_pos/5)*tksize+GRID_TOP, 178 (cursor_pos/5)*tksize+GRID_TOP,
166 tksize, tksize ); 179 tksize, tksize );
180#elif LCD_DEPTH >= 2
181/* grayscale doesn't have transparent bitmap ... */
182 int i,j;
183 i = ( cursor_pos%5 )*tksize;
184 j = ( cursor_pos/5 )*tksize;
185 rb->lcd_set_drawmode( DRMODE_SOLID );
186 rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP,
187 i+tksize-1+GRID_LEFT, j+GRID_TOP );
188 rb->lcd_drawline( i+GRID_LEFT, j+tksize-1+GRID_TOP,
189 i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP );
190 rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP,
191 i+GRID_LEFT, j+tksize-1+GRID_TOP );
192 rb->lcd_drawline( i+tksize-1+GRID_LEFT, j+GRID_TOP,
193 i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP );
167#else 194#else
168 int i,j; 195 int i,j;
169 i = (cursor_pos%5)*16; 196 i = (cursor_pos%5)*16;
@@ -179,7 +206,7 @@ static void draw_cursor(void) {
179 206
180/* clear the cursor where it is */ 207/* clear the cursor where it is */
181static void clear_cursor(void) { 208static void clear_cursor(void) {
182#if HAVE_LCD_COLOR 209#if LCD_DEPTH >= 2
183 draw_spot( cursor_pos ); 210 draw_spot( cursor_pos );
184#else 211#else
185 int i,j; 212 int i,j;
@@ -355,7 +382,7 @@ static bool flipit_loop(void) {
355 /* toggle the pieces */ 382 /* toggle the pieces */
356 if (!flipit_finished()) { 383 if (!flipit_finished()) {
357 flipit_toggle(); 384 flipit_toggle();
358#ifdef HAVE_LCD_COLOR 385#if LCD_DEPTH >= 2
359 draw_cursor(); 386 draw_cursor();
360#endif 387#endif
361 rb->lcd_update(); 388 rb->lcd_update();