X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=hacks%2Fworm.c;h=1989b3ab1ed2e14de8e853b1f446908b6c478818;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hp=7eb5fdf226d7a51ebe931539f376f6f84f29d4f3;hpb=5b7bc6e70fb439cf4c4bf771ae9f94077fe4fe08;p=xscreensaver diff --git a/hacks/worm.c b/hacks/worm.c index 7eb5fdf2..1989b3ab 100644 --- a/hacks/worm.c +++ b/hacks/worm.c @@ -2,9 +2,8 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* worm --- draw wiggly worms */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)worm.c 4.04 97/07/28 xlockmore"; - #endif /*- @@ -39,10 +38,6 @@ static const char sccsid[] = "@(#)worm.c 4.04 97/07/28 xlockmore"; */ #ifdef STANDALONE -# define PROGCLASS "Worm" -# define HACK_INIT init_worm -# define HACK_DRAW draw_worm -# define worm_opts xlockmore_opts # define DEFAULTS "*delay: 17000 \n" \ "*count: -20 \n" \ "*cycles: 10 \n" \ @@ -53,14 +48,18 @@ static const char sccsid[] = "@(#)worm.c 4.04 97/07/28 xlockmore"; "*right3d: red \n" \ "*left3d: blue \n" \ "*both3d: magenta \n" \ - "*none3d: black \n " + "*none3d: black \n" \ + "*fpsSolid: true \n" \ + # define SMOOTH_COLORS +# define reshape_worm 0 +# define worm_handle_event 0 # include "xlockmore.h" /* in xscreensaver distribution */ #else /* STANDALONE */ # include "xlock.h" /* in xlockmore distribution */ #endif /* STANDALONE */ -ModeSpecOpt worm_opts = +ENTRYPOINT ModeSpecOpt worm_opts = {0, NULL, 0, NULL, NULL}; #define MINSIZE 1 @@ -266,18 +265,14 @@ free_worms(wormstruct * wp) } } -void -init_worm(ModeInfo * mi) +ENTRYPOINT void +init_worm (ModeInfo * mi) { wormstruct *wp; int size = MI_SIZE(mi); int i, j; - if (worms == NULL) { - if ((worms = (wormstruct *) calloc(MI_NUM_SCREENS(mi), - sizeof (wormstruct))) == NULL) - return; - } + MI_INIT (mi, worms, 0); wp = &worms[MI_SCREEN(mi)]; if (MI_NPIXELS(mi) <= 2 || MI_WIN_IS_USE3D(mi)) wp->nc = 2; @@ -362,8 +357,8 @@ init_worm(ModeInfo * mi) XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi)); } -void -draw_worm(ModeInfo * mi) +ENTRYPOINT void +draw_worm (ModeInfo * mi) { Display *display = MI_DISPLAY(mi); Window window = MI_WINDOW(mi); @@ -408,7 +403,7 @@ draw_worm(ModeInfo * mi) wp->chromo = 0; } -void +ENTRYPOINT void release_worm(ModeInfo * mi) { if (worms != NULL) { @@ -421,8 +416,8 @@ release_worm(ModeInfo * mi) } } -void -refresh_worm(ModeInfo * mi) +ENTRYPOINT void +refresh_worm (ModeInfo * mi) { if (MI_WIN_IS_USE3D(mi)) /* The 3D code does drawing&clearing by XORing. We do not @@ -439,3 +434,5 @@ refresh_worm(ModeInfo * mi) } } } + +XSCREENSAVER_MODULE ("Worm", worm)