projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.40.tar.gz
[xscreensaver]
/
hacks
/
glx
/
swim.c
diff --git
a/hacks/glx/swim.c
b/hacks/glx/swim.c
index a7fccfeb41fb7b548b1f20eabaa56e982d723941..e20655a2935b1e3b7a536d4ae82c6516a31f5264 100644
(file)
--- a/
hacks/glx/swim.c
+++ b/
hacks/glx/swim.c
@@
-29,7
+29,7
@@
static const char sccsid[] = "@(#)swim.c 1.3 98/06/18 xlockmore";
* Thanks goes also to Brian Paul for making it possible and inexpensive
* to use OpenGL at home.
*
* Thanks goes also to Brian Paul for making it possible and inexpensive
* to use OpenGL at home.
*
- * My e-mail address is lassauge@
sagem.fr
+ * My e-mail address is lassauge@
users.sourceforge.net
*
* Eric Lassauge (May-13-1998)
*
*
* Eric Lassauge (May-13-1998)
*
@@
-109,7
+109,6
@@
WhalePilot(fishRec * fish, float whalespeed, Bool whaledir)
void
SharkPilot(fishRec * fish, float sharkspeed)
{
void
SharkPilot(fishRec * fish, float sharkspeed)
{
- static int sign = 1;
float X, Y, Z, tpsi, ttheta, thetal;
fish->xt = 60000.0;
float X, Y, Z, tpsi, ttheta, thetal;
fish->xt = 60000.0;
@@
-157,9
+156,9
@@
SharkPilot(fishRec * fish, float sharkspeed)
}
} else {
if (NRAND(100) > 98) {
}
} else {
if (NRAND(100) > 98) {
-
sign = 1 - sign
;
+
fish->sign = (fish->sign < 0 ? 1 : -1)
;
}
}
- fish->psi +=
sign
;
+ fish->psi +=
(fish->sign ? 1 : -1)
;
if (fish->psi > 180.0) {
fish->psi -= 360.0;
}
if (fish->psi > 180.0) {
fish->psi -= 360.0;
}