projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://slackware.bholcomb.com/slackware/slackware-11.0/source/xap/xscreensaver/xscree...
[xscreensaver]
/
hacks
/
glx
/
swim.c
diff --git
a/hacks/glx/swim.c
b/hacks/glx/swim.c
index a1ddefe1c60d6b24e820e12231c458f78a549abb..e20655a2935b1e3b7a536d4ae82c6516a31f5264 100644
(file)
--- a/
hacks/glx/swim.c
+++ b/
hacks/glx/swim.c
@@
-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;
}