mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-27 07:46:24 -04:00
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
This commit is contained in:
parent
26924522c5
commit
e86ee9a33f
2 changed files with 16 additions and 2 deletions
|
|
@ -39,6 +39,16 @@
|
||||||
static short particles[NUM_PARTICLES][2];
|
static short particles[NUM_PARTICLES][2];
|
||||||
static struct plugin_api* rb;
|
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)
|
static bool particle_exists(int particle)
|
||||||
{
|
{
|
||||||
if (particles[particle][0]>=0 && particles[particle][1]>=0 &&
|
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++) {
|
for (i=0; i<NUM_PARTICLES; i++) {
|
||||||
if (particle_exists(i)) {
|
if (particle_exists(i)) {
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#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
|
#else
|
||||||
pgfx_clearpixel(particles[i][0],particles[i][1]);
|
pgfx_clearpixel(particles[i][0],particles[i][1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -94,7 +105,8 @@ static void snow_move(void)
|
||||||
}
|
}
|
||||||
if (particle_exists(i))
|
if (particle_exists(i))
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#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
|
#else
|
||||||
pgfx_drawpixel(particles[i][0],particles[i][1]);
|
pgfx_drawpixel(particles[i][0],particles[i][1]);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -102,6 +114,7 @@ static void snow_move(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void snow_init(void)
|
static void snow_init(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
|
||||||
|
|
@ -113,3 +113,4 @@ Richard Ott
|
||||||
Luca Burelli
|
Luca Burelli
|
||||||
Alessio Lenzi
|
Alessio Lenzi
|
||||||
David Bryant
|
David Bryant
|
||||||
|
Martin Arver
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue