summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-05-21 13:11:50 +0000
committerJens Arnold <amiconn@rockbox.org>2005-05-21 13:11:50 +0000
commite86ee9a33fe62f7c5ac4579c339382221d8fc2cd (patch)
tree91a71cbc90e895c8c96eabe86b135db029b08499 /apps
parent26924522c594ee0ea7b739ce6b5b3c3890dbaade (diff)
Enhancement by Martin Arver: The snow flakes are now tiny bitmaps for better visibility on slow LCDs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6498 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/snow.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index a0725beefb..09c416d655 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -39,6 +39,16 @@
static short particles[NUM_PARTICLES][2];
static struct plugin_api* rb;
+#ifdef HAVE_LCD_BITMAP
+#if LCD_WIDTH >= 160
+#define FLAKE_WIDTH 5
+static const unsigned char flake[] = {0x0a,0x04,0x1f,0x04,0x0a};
+#else
+#define FLAKE_WIDTH 3
+static const unsigned char flake[] = {0x02,0x07,0x02};
+#endif
+#endif
+
static bool particle_exists(int particle)
{
if (particles[particle][0]>=0 && particles[particle][1]>=0 &&
@@ -72,7 +82,8 @@ static void snow_move(void)
for (i=0; i<NUM_PARTICLES; i++) {
if (particle_exists(i)) {
#ifdef HAVE_LCD_BITMAP
- rb->lcd_clearpixel(particles[i][0],particles[i][1]);
+ rb->lcd_clearrect(particles[i][0],particles[i][1],
+ FLAKE_WIDTH,FLAKE_WIDTH);
#else
pgfx_clearpixel(particles[i][0],particles[i][1]);
#endif
@@ -94,7 +105,8 @@ static void snow_move(void)
}
if (particle_exists(i))
#ifdef HAVE_LCD_BITMAP
- rb->lcd_drawpixel(particles[i][0],particles[i][1]);
+ rb->lcd_bitmap(flake,particles[i][0],particles[i][1],
+ FLAKE_WIDTH,FLAKE_WIDTH,true);
#else
pgfx_drawpixel(particles[i][0],particles[i][1]);
#endif
@@ -102,6 +114,7 @@ static void snow_move(void)
}
}
+
static void snow_init(void)
{
int i;