X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fhelix.c;h=c2d81fa22dfd6785931160d3c8e03ed688e12135;hb=ce3185de9d9705e259f2b60dd4b5509007fa17d4;hp=cb6bd38b3e91b96848748b04a9283c9df03dfb86;hpb=186b0b9f1638444c650c9273df38085e0db71e4a;p=xscreensaver diff --git a/hacks/helix.c b/hacks/helix.c index cb6bd38b..c2d81fa2 100644 --- a/hacks/helix.c +++ b/hacks/helix.c @@ -1,5 +1,5 @@ /* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997 - * Jamie Zawinski + * Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -26,12 +26,9 @@ static double sins [360]; static double coss [360]; -static GC draw_gc, erase_gc; +static GC draw_gc; static unsigned int default_fg_pixel; -static int erase_speed, sleep_time, erase_mode; - -void erase_window (Display *dpy, Window win, GC gc, int width, int height, - int mode, int delay); +static int sleep_time; static void init_helix (Display *dpy, Window window) @@ -46,7 +43,6 @@ init_helix (Display *dpy, Window window) get_pixel_resource ("foreground", "Foreground", dpy, cmap); draw_gc = XCreateGC (dpy, window, GCForeground, &gcv); gcv.foreground = get_pixel_resource ("background", "Background", dpy, cmap); - erase_gc = XCreateGC (dpy, window, GCForeground, &gcv); for (i = 0; i < 360; i++) { @@ -257,7 +253,6 @@ random_trig (Display *dpy, Window window, XColor *color, Bool *got_color) static void random_helix_or_trig (Display *dpy, Window window) { - int i; Bool free_color = False; XColor color; int width, height; @@ -276,7 +271,7 @@ random_helix_or_trig (Display *dpy, Window window) XSync (dpy, True); sleep ( sleep_time ); - erase_window(dpy, window, erase_gc, width, height, erase_mode, erase_speed); + erase_full_window(dpy, window); if (free_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0); XSync (dpy, True); @@ -287,17 +282,13 @@ random_helix_or_trig (Display *dpy, Window window) char *progclass = "Helix"; char *defaults [] = { - "Helix.background: black", /* to placate SGI */ - "Helix.eraseSpeed: 400", - "Helix.delay: 5", - "Helix.eraseMode: -1", + ".background: black", + "*delay: 5", 0 }; XrmOptionDescRec options [] = { - { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 }, { "-delay", ".delay", XrmoptionSepArg, 0 }, - { "-erase-mode", ".eraseMode", XrmoptionSepArg, 0 }, { 0 }, }; int options_size = (sizeof (options) / sizeof (options[0])); @@ -305,9 +296,7 @@ int options_size = (sizeof (options) / sizeof (options[0])); void screenhack (Display *dpy, Window window) { - erase_speed = get_integer_resource("eraseSpeed", "Integer"); sleep_time = get_integer_resource("delay", "Integer"); - erase_mode = get_integer_resource("eraseMode", "Integer"); init_helix (dpy, window); while (1) random_helix_or_trig (dpy, window);