X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fgalaxy.c;h=3a6e1f78582c08671210d80cb6de507696cfdfb1;hb=39809ded547bdbb08207d3e514950425215b4410;hp=f060591c0eed2a8b6d930d9d21db7caf57e1f63d;hpb=de460e831dc8578acfa8b72251ab9346c99c1f96;p=xscreensaver diff --git a/hacks/galaxy.c b/hacks/galaxy.c index f060591c..3a6e1f78 100644 --- a/hacks/galaxy.c +++ b/hacks/galaxy.c @@ -43,8 +43,13 @@ static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore"; # define DEFAULTS "*delay: 20000 \n" \ "*count: -5 \n" \ "*cycles: 250 \n" \ - "*ncolors: 64 \n" + "*ncolors: 64 \n" \ + "*fpsSolid: true \n" \ + "*ignoreRotation: True \n" \ + "*lowrez: True \n" \ + # define UNIFORM_COLORS +# define release_galaxy 0 # define reshape_galaxy 0 # define galaxy_handle_event 0 # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -156,9 +161,10 @@ x-axis */ static unistruct *universes = NULL; -static void -free_galaxies(unistruct * gp) +ENTRYPOINT void +free_galaxy(ModeInfo * mi) { + unistruct *gp = &universes[MI_SCREEN(mi)]; if (gp->galaxies != NULL) { int i; @@ -190,7 +196,7 @@ startover(ModeInfo * mi) gp->rot_x = 0; if (MI_BATCHCOUNT(mi) < -MINGALAXIES) - free_galaxies(gp); + free_galaxy(mi); gp->ngalaxies = MI_BATCHCOUNT(mi); if (gp->ngalaxies < -MINGALAXIES) gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES; @@ -305,14 +311,10 @@ 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); gp = &universes[MI_SCREEN(mi)]; -# ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ +# ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ dbufp = False; # endif @@ -438,23 +440,12 @@ draw_galaxy(ModeInfo * mi) startover(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; - } -} - +#ifndef STANDALONE ENTRYPOINT void refresh_galaxy(ModeInfo * mi) { /* Do nothing, it will refresh by itself */ } +#endif XSCREENSAVER_MODULE ("Galaxy", galaxy)