X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fthornbird.c;h=c2edeb7c90f2d21ae0f5dfa84378ae733cd8e528;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=eb35ae2b82e5d36a13116c346d39d82e010b8d67;hpb=a94197e76a5dea5cb60542840809d6c20d0abbf3;p=xscreensaver diff --git a/hacks/thornbird.c b/hacks/thornbird.c index eb35ae2b..c2edeb7c 100644 --- a/hacks/thornbird.c +++ b/hacks/thornbird.c @@ -1,13 +1,12 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* thornbird --- continuously varying Thornbird set */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)thornbird.c 5.00 2000/11/01 xlockmore"; - #endif /*- - * Copyright (c) 1996 by Tim Auckland + * Copyright (c) 1996 by Tim Auckland * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, @@ -31,24 +30,24 @@ static const char sccsid[] = "@(#)thornbird.c 5.00 2000/11/01 xlockmore"; */ #ifdef STANDALONE -#define MODE_thornbird -#define PROGCLASS "Thornbird" -#define HACK_INIT init_thornbird -#define HACK_DRAW draw_thornbird -#define thornbird_opts xlockmore_opts -#define DEFAULTS "*delay: 10000 \n" \ - "*count: 800 \n" \ - "*cycles: 16 \n" \ - "*ncolors: 64 \n" -#define SMOOTH_COLORS -#include "xlockmore.h" /* in xscreensaver distribution */ +# define MODE_thornbird +#define DEFAULTS "*delay: 10000 \n" \ + "*count: 100 \n" \ + "*cycles: 400 \n" \ + "*ncolors: 64 \n" \ + "*fpsSolid: true \n" \ + "*ignoreRotation: True \n" \ + +# define BRIGHT_COLORS +# define thornbird_handle_event 0 +# include "xlockmore.h" /* in xscreensaver distribution */ #else /* STANDALONE */ -#include "xlock.h" /* in xlockmore distribution */ +# include "xlock.h" /* in xlockmore distribution */ #endif /* STANDALONE */ #ifdef MODE_thornbird -ModeSpecOpt thornbird_opts = +ENTRYPOINT ModeSpecOpt thornbird_opts = {0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL}; #ifdef USE_MODULES @@ -105,8 +104,8 @@ free_thornbird(thornbirdstruct *hp) } } -void -init_thornbird(ModeInfo * mi) +ENTRYPOINT void +init_thornbird (ModeInfo * mi) { thornbirdstruct *hp; @@ -161,7 +160,7 @@ init_thornbird(ModeInfo * mi) } -void +ENTRYPOINT void draw_thornbird(ModeInfo * mi) { Display *dsp = MI_DISPLAY(mi); @@ -223,6 +222,7 @@ draw_thornbird(ModeInfo * mi) MI_IS_DRAWN(mi) = True; + if (MI_COUNT(mi) < 1) MI_COUNT(mi) = 1; if (hp->pointBuffer[erase] == NULL) { if ((hp->pointBuffer[erase] = (XPoint *) malloc(MI_COUNT(mi) * sizeof (XPoint))) == NULL) { @@ -236,7 +236,11 @@ draw_thornbird(ModeInfo * mi) } if (MI_NPIXELS(mi) > 2) { XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix)); +#if 0 if (erase == 0) /* change colours after "cycles" cycles */ +#else + if (!((hp->inc + 1) % (1 + (MI_CYCLES(mi) / 3)))) /* jwz: sooner */ +#endif if (++hp->pix >= MI_NPIXELS(mi)) hp->pix = 0; } else @@ -245,10 +249,16 @@ draw_thornbird(ModeInfo * mi) XDrawPoints(dsp, win, gc, hp->pointBuffer[current], batchcount, CoordModeOrigin); hp->inc++; +} +ENTRYPOINT void +reshape_thornbird(ModeInfo * mi, int width, int height) +{ + XClearWindow (MI_DISPLAY (mi), MI_WINDOW(mi)); + init_thornbird (mi); } -void +ENTRYPOINT void release_thornbird(ModeInfo * mi) { if (thornbirds != NULL) { @@ -261,10 +271,13 @@ release_thornbird(ModeInfo * mi) } } -void -refresh_thornbird(ModeInfo * mi) +ENTRYPOINT void +refresh_thornbird (ModeInfo * mi) { MI_CLEARWINDOW(mi); } + +XSCREENSAVER_MODULE ("Thornbird", thornbird) + #endif /* MODE_thornbird */