From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver] / hacks / galaxy.c
index 7f72af5b2ccb22b0aee64cb6c13af4805341d13f..3a6e1f78582c08671210d80cb6de507696cfdfb1 100644 (file)
@@ -46,9 +46,12 @@ static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore";
                                        "*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 */
 #else  /* !STANDALONE */
 # include "xlock.h"     /* from the xlockmore distribution */
@@ -158,8 +161,8 @@ x-axis */
 
 static unistruct *universes = NULL;
 
-static void
-free_galaxies(ModeInfo * mi)
+ENTRYPOINT void
+free_galaxy(ModeInfo * mi)
 {
  unistruct  *gp = &universes[MI_SCREEN(mi)];
  if (gp->galaxies != NULL) {
@@ -193,7 +196,7 @@ startover(ModeInfo * mi)
  gp->rot_x = 0;
 
  if (MI_BATCHCOUNT(mi) < -MINGALAXIES)
-  free_galaxies(mi);
+  free_galaxy(mi);
  gp->ngalaxies = MI_BATCHCOUNT(mi);
  if (gp->ngalaxies < -MINGALAXIES)
   gp->ngalaxies = NRAND(-gp->ngalaxies - MINGALAXIES + 1) + MINGALAXIES;
@@ -308,7 +311,7 @@ init_galaxy(ModeInfo * mi)
 {
  unistruct  *gp;
 
- MI_INIT (mi, universes, free_galaxies);
+ MI_INIT (mi, universes);
  gp = &universes[MI_SCREEN(mi)];
 
 # ifdef HAVE_JWXYZ     /* Don't second-guess Quartz's double-buffering */
@@ -437,29 +440,12 @@ draw_galaxy(ModeInfo * mi)
     startover(mi);
 }
 
-ENTRYPOINT void
-reshape_galaxy(ModeInfo * mi, int width, int height)
-{
-  XClearWindow (MI_DISPLAY (mi), MI_WINDOW(mi));
-  init_galaxy (mi);
-}
-
+#ifndef STANDALONE
 ENTRYPOINT void
 refresh_galaxy(ModeInfo * mi)
 {
  /* Do nothing, it will refresh by itself */
 }
-
-ENTRYPOINT Bool
-galaxy_handle_event (ModeInfo *mi, XEvent *event)
-{
-  if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
-    {
-      reshape_galaxy (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
-      return True;
-    }
-  return False;
-}
-
+#endif
 
 XSCREENSAVER_MODULE ("Galaxy", galaxy)