X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglhanoi.c;h=df62a37151bf6e763fce15c006e20eb44bd2183f;hb=de460e831dc8578acfa8b72251ab9346c99c1f96;hp=ef10c20ec7b1d594e2002c893de1604970e7946c;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/glx/glhanoi.c b/hacks/glx/glhanoi.c index ef10c20e..df62a371 100644 --- 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 speed; 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); + /* 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;