summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-02-10 13:15:06 +0100
committerDanny Baumann <dannybaumann@web.de>2008-02-10 13:15:06 +0100
commitd0eb3b5db1374e18efe266859d350080aa17ad45 (patch)
tree6150352ea156f695a67bc66f15a342120392075e
parent08b10403d9530b5241cc84b4572d98cd4297045f (diff)
downloadsnow-d0eb3b5db1374e18efe266859d350080aa17ad45.tar.gz
snow-d0eb3b5db1374e18efe266859d350080aa17ad45.tar.bz2
Fix division-by-zero when snow speed is 100.
-rw-r--r--snow.c4
-rw-r--r--snow.xml.in2
2 files changed, 3 insertions, 3 deletions
diff --git a/snow.c b/snow.c
index 8be61e9..b2e9d00 100644
--- a/snow.c
+++ b/snow.c
@@ -125,9 +125,9 @@ static void
snowMove (CompDisplay *d,
SnowFlake *sf)
{
- float tmp = 1.0f / (100.0f - snowGetSnowSpeed (d));
+ float tmp = 1.0f / (101.0f - snowGetSnowSpeed (d));
int snowUpdateDelay = snowGetSnowUpdateDelay (d);
-
+
sf->x += (sf->xs * (float) snowUpdateDelay) * tmp;
sf->y += (sf->ys * (float) snowUpdateDelay) * tmp;
sf->z += (sf->zs * (float) snowUpdateDelay) * tmp;
diff --git a/snow.xml.in b/snow.xml.in
index 3c6eb27..3e53d74 100644
--- a/snow.xml.in
+++ b/snow.xml.in
@@ -33,7 +33,7 @@
<_short>Snow Speed</_short>
<_long>Speed of falling snow</_long>
<default>85</default>
- <min>0</min>
+ <min>1</min>
<max>100</max>
</option>
<option name="snow_update_delay" type="int">