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.17.tar.gz
[xscreensaver]
/
hacks
/
glx
/
swim.c
diff --git
a/hacks/glx/swim.c
b/hacks/glx/swim.c
index 0848d46db259f49af1bbc477f034bee971106c63..e20655a2935b1e3b7a536d4ae82c6516a31f5264 100644
(file)
--- a/
hacks/glx/swim.c
+++ b/
hacks/glx/swim.c
@@
-1,8
+1,7
@@
/* atlantis --- Shows moving 3D sea animals */
/* atlantis --- Shows moving 3D sea animals */
-#if
!defined( lint ) && !defined( SABER )
+#if
0
static const char sccsid[] = "@(#)swim.c 1.3 98/06/18 xlockmore";
static const char sccsid[] = "@(#)swim.c 1.3 98/06/18 xlockmore";
-
#endif
/* Copyright (c) E. Lassauge, 1998. */
#endif
/* Copyright (c) E. Lassauge, 1998. */
@@
-30,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)
*
@@
-110,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;
@@
-158,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;
}