X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fflow.c;h=cfbc2b1e501d6d371332e57bc18887bfa216be9f;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=64347332f7b55d2a1df40ddb57b1180b94e8c93c;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/flow.c b/hacks/flow.c index 64347332..cfbc2b1e 100644 --- a/hacks/flow.c +++ b/hacks/flow.c @@ -2,10 +2,8 @@ /* flow --- flow of strange bees */ #if 0 -#if !defined( lint ) && !defined( SABER ) static const char sccsid[] = "@(#)flow.c 5.00 2000/11/01 xlockmore"; #endif -#endif /*- * Copyright (c) 1996 by Tim Auckland @@ -104,8 +102,6 @@ static const char sccsid[] = "@(#)flow.c 5.00 2000/11/01 xlockmore"; "*cycles: 10000 \n" \ "*ncolors: 200 \n" -# define reshape_flow 0 -# define flow_handle_event 0 # include "xlockmore.h" /* in xscreensaver distribution */ #else /* STANDALONE */ # include "xlock.h" /* in xlockmore distribution */ @@ -776,11 +772,13 @@ init_flow (ModeInfo * mi) free_flow(sp); sp->beecount = MI_COUNT(mi); - if (sp->beecount < 0) { /* random variations */ + if (!sp->beecount) { + sp->beecount = 1; /* The camera requires 1 or more */ + } else if (sp->beecount < 0) { /* random variations */ sp->beecount = NRAND(-sp->beecount) + 1; /* Minimum 1 */ } -# ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ +# ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ dbufp = False; # endif @@ -807,7 +805,7 @@ init_flow (ModeInfo * mi) allocate(sp->csegs, XSegment, (sp->beecount + BOX_L) * MI_NPIXELS(mi) * sp->taillen); allocate(sp->cnsegs, int, MI_NPIXELS(mi)); - allocate(sp->old_segs, XSegment, sp->beecount * sp->taillen); + allocate(sp->old_segs, XSegment, (sp->beecount + BOX_L) * sp->taillen); allocate(sp->p, dvector, sp->beecount * sp->taillen); } @@ -836,7 +834,7 @@ draw_flow (ModeInfo * mi) if (sp->csegs == NULL) return; -#ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ +#ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ XClearWindow (MI_DISPLAY(mi), MI_WINDOW(mi)); #endif @@ -1111,7 +1109,7 @@ draw_flow (ModeInfo * mi) are ok, they help to outline the Poincare' slice. */ for(j = i; j < end; j++) Y(j,b) = Y(i,b); - begin = i + 1; + /*begin = i + 1;*/ break; } @@ -1201,6 +1199,13 @@ draw_flow (ModeInfo * mi) } } +ENTRYPOINT void +reshape_flow(ModeInfo * mi, int width, int height) +{ + init_flow (mi); +} + + ENTRYPOINT void release_flow (ModeInfo * mi) { @@ -1220,6 +1225,18 @@ refresh_flow (ModeInfo * mi) if(!dbufp) MI_CLEARWINDOW(mi); } +ENTRYPOINT Bool +flow_handle_event (ModeInfo *mi, XEvent *event) +{ + if (screenhack_event_helper (MI_DISPLAY(mi), MI_WINDOW(mi), event)) + { + init_flow (mi); + return True; + } + return False; +} + + XSCREENSAVER_MODULE ("Flow", flow) #endif /* MODE_flow */