From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver] / hacks / glx / starwars.c
index a726bb300a006840e5aaaed5db4b88575d70b9a1..d75f014c12a449827561f9683bbdf7ec6e0b3d0f 100644 (file)
@@ -46,8 +46,8 @@
                 "*textLiteral: " DEF_TEXT "\n" \
                 "*program: xscreensaver-text --cols 0"  /* don't wrap */
 
-# define refresh_sws 0
-# define sws_handle_event 0
+# define release_sws 0
+# define sws_handle_event xlockmore_no_events
 #undef countof
 #define countof(x) (sizeof((x))/sizeof((*x)))
 
@@ -723,14 +723,7 @@ init_sws (ModeInfo *mi)
 
   sws_configuration *sc = 0;
 
-  if (!scs) {
-    scs = (sws_configuration *)
-      calloc (MI_NUM_SCREENS(mi), sizeof (sws_configuration));
-    if (!scs) {
-      fprintf(stderr, "%s: out of memory\n", progname);
-      exit(1);
-    }
-  }
+  MI_INIT (mi, scs);
 
   sc = &scs[MI_SCREEN(mi)];
 
@@ -1055,21 +1048,13 @@ draw_sws (ModeInfo *mi)
 }
 
 ENTRYPOINT void
-release_sws (ModeInfo *mi)
+free_sws (ModeInfo *mi)
 {
-  if (scs) {
-    int screen;
-    for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
-      sws_configuration *sc = &scs[screen];
-      if (sc->tc)
-        textclient_close (sc->tc);
-
-      /* #### there's more to free here */
-    }
-    free (scs);
-    scs = 0;
-  }
-  FreeAllGL(mi);
+  sws_configuration *sc = &scs[MI_SCREEN(mi)];
+  if (sc->tc)
+    textclient_close (sc->tc);
+
+  /* #### there's more to free here */
 }