From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / triangle.c
index 48a8b20d67c86090fe53a07d2e1509a78a7d4c9b..79fe819ce77b4c27f27ea573669bd0d28c9ce3c5 100644 (file)
@@ -51,7 +51,6 @@ static const char sccsid[] = "@(#)triangle.c  4.04 97/07/28 xlockmore";
                                        "*fpsSolid: true \n" \
 
 # define SMOOTH_COLORS
-# define reshape_triangle 0
 # define triangle_handle_event 0
 # include "xlockmore.h"                /* in xscreensaver distribution */
 #else /* STANDALONE */
@@ -299,11 +298,11 @@ draw_triangle (ModeInfo * mi)
                                XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
                                if (!mono_p)
                                  {
-                                       free_colors(mi->dpy, mi->xgwa.colormap, mi->colors,
+                                       free_colors(mi->xgwa.screen, mi->xgwa.colormap, mi->colors,
                                                                mi->npixels);
                     mi->npixels = 
                       get_integer_resource (mi->dpy, "ncolors", "Integer");
-                                       make_smooth_colormap (mi->dpy,
+                                       make_smooth_colormap (mi->xgwa.screen,
                                                                                  mi->xgwa.visual, mi->xgwa.colormap,
                                                                                  mi->colors, &mi->npixels,
                                                                                  True, &mi->writable_p, True);
@@ -345,6 +344,13 @@ draw_triangle (ModeInfo * mi)
        }
 }
 
+ENTRYPOINT void
+reshape_triangle(ModeInfo * mi, int width, int height)
+{
+  XClearWindow (MI_DISPLAY (mi), MI_WINDOW(mi));
+  init_triangle (mi);
+}
+
 ENTRYPOINT void
 release_triangle(ModeInfo * mi)
 {