X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fgalaxy.c;h=7f72af5b2ccb22b0aee64cb6c13af4805341d13f;hp=b8fbd0c4ce8db57ba5a251fa46b4b8be2ee40706;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/hacks/galaxy.c b/hacks/galaxy.c index b8fbd0c4..7f72af5b 100644 --- a/hacks/galaxy.c +++ b/hacks/galaxy.c @@ -48,6 +48,7 @@ static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore"; "*ignoreRotation: True \n" \ # define UNIFORM_COLORS +# define release_galaxy 0 # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ # include "xlock.h" /* from the xlockmore distribution */ @@ -158,8 +159,9 @@ x-axis */ static unistruct *universes = NULL; static void -free_galaxies(unistruct * gp) +free_galaxies(ModeInfo * mi) { + unistruct *gp = &universes[MI_SCREEN(mi)]; if (gp->galaxies != NULL) { int i; @@ -191,7 +193,7 @@ startover(ModeInfo * mi) gp->rot_x = 0; if (MI_BATCHCOUNT(mi) < -MINGALAXIES) - free_galaxies(gp); + free_galaxies(mi); gp->ngalaxies = MI_BATCHCOUNT(mi); if (gp->ngalaxies < -MINGALAXIES) gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES; @@ -306,11 +308,7 @@ init_galaxy(ModeInfo * mi) { unistruct *gp; - if (universes == NULL) { - if ((universes = (unistruct *) calloc(MI_NUM_SCREENS(mi), - sizeof (unistruct))) == NULL) - return; - } + MI_INIT (mi, universes, free_galaxies); gp = &universes[MI_SCREEN(mi)]; # ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ @@ -446,19 +444,6 @@ reshape_galaxy(ModeInfo * mi, int width, int height) init_galaxy (mi); } -ENTRYPOINT void -release_galaxy(ModeInfo * mi) -{ - if (universes != NULL) { - int screen; - - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) - free_galaxies(&universes[screen]); - (void) free((void *) universes); - universes = NULL; - } -} - ENTRYPOINT void refresh_galaxy(ModeInfo * mi) {