projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://www.tienza.es/crux/src/www.jwz.org/xscreensaver/xscreensaver-5.05.tar.gz
[xscreensaver]
/
hacks
/
glx
/
glhanoi.c
diff --git
a/hacks/glx/glhanoi.c
b/hacks/glx/glhanoi.c
index ef10c20ec7b1d594e2002c893de1604970e7946c..df62a37151bf6e763fce15c006e20eb44bd2183f 100644
(file)
--- a/
hacks/glx/glhanoi.c
+++ b/
hacks/glx/glhanoi.c
@@
-136,7
+136,6
@@
typedef struct {
float diskHeight;
float *diskPos; /* pre-computed disk positions on rods */
Disk *disk;
float diskHeight;
float *diskPos; /* pre-computed disk positions on rods */
Disk *disk;
- float speed;
GLint floorList;
GLint baseList;
GLint poleList;
GLint floorList;
GLint baseList;
GLint poleList;
@@
-1312,6
+1311,11
@@
ENTRYPOINT void init_glhanoi(ModeInfo * mi)
if (glhanoi->numberOfDisks <= 1)
glhanoi->numberOfDisks = 3 + (int) BELLRAND(9);
if (glhanoi->numberOfDisks <= 1)
glhanoi->numberOfDisks = 3 + (int) BELLRAND(9);
+ /* magicnumber is a bitfield, so we can't have more than 31 discs
+ on a system with 4-byte ints. */
+ if (glhanoi->numberOfDisks >= 8 * sizeof(int))
+ glhanoi->numberOfDisks = (8 * sizeof(int)) - 1;
+
glhanoi->maxDiskIdx = glhanoi->numberOfDisks - 1;
glhanoi->wire = MI_IS_WIREFRAME(mi);
glhanoi->light = light;
glhanoi->maxDiskIdx = glhanoi->numberOfDisks - 1;
glhanoi->wire = MI_IS_WIREFRAME(mi);
glhanoi->light = light;