From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / demon.c
index 3d35dca5aef3b6f52cddbdf4a2f287c975b1fd4a..199d899975e2dbdaa627a700dbb4c2c7b99984fe 100644 (file)
@@ -55,11 +55,11 @@ static const char sccsid[] = "@(#)demon.c   5.00 2000/11/01 xlockmore";
 # define DEFAULTS      "*delay:   50000 \n" \
                                        "*count:   0     \n" \
                                        "*cycles:  1000  \n" \
-                                       "*size:    -   \n" \
+                                       "*size:    -30   \n" \
                                        "*ncolors: 64    \n" \
                                        "*fpsSolid: true    \n" \
+                                   "*ignoreRotation: True  \n" \
 
-# define demon_handle_event 0
 # define UNIFORM_COLORS
 # include "xlockmore.h"                /* in xscreensaver distribution */
 #else /* STANDALONE */
@@ -165,7 +165,6 @@ drawcell(ModeInfo * mi, int col, int row, unsigned char state)
                gc = MI_GC(mi);
        } else {
                XGCValues   gcv;
-
 #ifdef DO_STIPPLE
                gcv.stipple = dp->pixmaps[(state - 1) % (NUMSTIPPLES - 1)];
 #endif /* DO_STIPPLE */
@@ -466,6 +465,10 @@ init_demon (ModeInfo * mi)
 #endif /* DO_STIPPLE */
        free_struct(dp);
 
+#ifdef HAVE_COCOA
+    jwxyz_XSetAntiAliasing (MI_DISPLAY(mi), MI_GC(mi), False);
+#endif
+
        for (nk = 0; nk < NEIGHBORKINDS; nk++) {
                if (neighbors == plots[0][nk]) {
                        dp->neighbors = plots[0][nk];
@@ -980,6 +983,19 @@ refresh_demon (ModeInfo * mi)
        dp->redrawpos = 0;
 }
 
+ENTRYPOINT Bool
+demon_handle_event (ModeInfo *mi, XEvent *event)
+{
+  if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event))
+    {
+      reshape_demon (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
+      return True;
+    }
+  return False;
+}
+
+
+
 XSCREENSAVER_MODULE ("Demon", demon)
 
 #endif /* MODE_demon */