summaryrefslogtreecommitdiff
path: root/apps/plugins/snow.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/snow.c')
-rw-r--r--apps/plugins/snow.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index 3ef34bb8b8..b9fc340e3f 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -20,7 +20,7 @@
20 20
21#ifdef HAVE_LCD_BITMAP 21#ifdef HAVE_LCD_BITMAP
22 22
23#define NUM_PARTICLES 100 23#define NUM_PARTICLES (LCD_WIDTH * LCD_HEIGHT / 72)
24 24
25static short particles[NUM_PARTICLES][2]; 25static short particles[NUM_PARTICLES][2];
26static struct plugin_api* rb; 26static struct plugin_api* rb;
@@ -28,7 +28,7 @@ static struct plugin_api* rb;
28static bool particle_exists(int particle) 28static bool particle_exists(int particle)
29{ 29{
30 if (particles[particle][0]>=0 && particles[particle][1]>=0 && 30 if (particles[particle][0]>=0 && particles[particle][1]>=0 &&
31 particles[particle][0]<112 && particles[particle][1]<64) 31 particles[particle][0]<LCD_WIDTH && particles[particle][1]<LCD_HEIGHT)
32 return true; 32 return true;
33 else 33 else
34 return false; 34 return false;
@@ -40,7 +40,7 @@ static int create_particle(void)
40 40
41 for (i=0; i<NUM_PARTICLES; i++) { 41 for (i=0; i<NUM_PARTICLES; i++) {
42 if (!particle_exists(i)) { 42 if (!particle_exists(i)) {
43 particles[i][0]=(rb->rand()%112); 43 particles[i][0]=(rb->rand()%LCD_WIDTH);
44 particles[i][1]=0; 44 particles[i][1]=0;
45 return i; 45 return i;
46 } 46 }