X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fsproingies.c;h=4752d41d79a59a0c00ff58636d7d062e85169be5;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=0892eff873da2e11d8bf81fdf34ada83201767ac;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/hacks/glx/sproingies.c b/hacks/glx/sproingies.c index 0892eff8..4752d41d 100644 --- a/hacks/glx/sproingies.c +++ b/hacks/glx/sproingies.c @@ -36,7 +36,7 @@ static const char sccsid[] = "@(#)sproingies.c 4.04 97/07/28 xlockmore"; #ifdef USE_GL -#ifndef HAVE_COCOA +#if !defined(HAVE_JWZGLES) && !defined(HAVE_COCOA) # include #endif @@ -551,7 +551,11 @@ RenderSproingie(int t, sp_instance * si) glTranslatef((GLfloat) (thisSproingie->x) + 0.5, (GLfloat) (thisSproingie->y) + 0.5, (GLfloat) (thisSproingie->z) - 0.5); - scale = (GLfloat) (1 << (thisSproingie->frame - BOOM_FRAME)); + { + int boom_scale = thisSproingie->frame - BOOM_FRAME; + if (boom_scale >= 31) boom_scale = 31; + scale = (GLfloat) (1 << boom_scale); + } glScalef(scale, scale, scale); if (!si->wireframe) { if (!si->mono) @@ -760,6 +764,9 @@ void CleanupSproingies(int screen) { sp_instance *si = &si_list[screen]; + + if (! si) return; + /* int t; if (si->SproingieBoom) { @@ -804,6 +811,9 @@ InitSproingies(int wfmode, int grnd, int mspr, int smrtspr, sp_instance *si; int t; + active_screens++; + CleanupSproingies(screen); + if (si_list == NULL) { if ((si_list = (sp_instance *) calloc(numscreens, sizeof (sp_instance))) == NULL) @@ -811,9 +821,6 @@ InitSproingies(int wfmode, int grnd, int mspr, int smrtspr, } si = &si_list[screen]; - active_screens++; - CleanupSproingies(screen); - if (mspr < 0) mspr = 0; if (mspr >= MAXSPROING)