summaryrefslogtreecommitdiffstats
path: root/progs/samples/star.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-05-09 17:14:19 +0000
committerBrian Paul <[email protected]>2001-05-09 17:14:19 +0000
commit7b9ff48d022f43e129ad94e7ca9783a0b007a2c4 (patch)
treebc433fa7e45ea4260913b024635323386477a397 /progs/samples/star.c
parentf2bfc66c5db02d26e32af5e46b2abb3ceb75ae34 (diff)
make sure rotation plugged into sin/cos lookup tables is always positive, fixes FP exception
Diffstat (limited to 'progs/samples/star.c')
-rw-r--r--progs/samples/star.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/progs/samples/star.c b/progs/samples/star.c
index 62d7d854852..570c3e19f9d 100644
--- a/progs/samples/star.c
+++ b/progs/samples/star.c
@@ -129,6 +129,9 @@ void MoveStars(void)
if (stars[n].rotation > MAXANGLES) {
stars[n].rotation = 0.0;
}
+ else if (stars[n].rotation < 0.0) {
+ stars[n].rotation += 360.0;
+ }
}
}