X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Ffiberlamp.c;h=43157751415f3b7c128f88b4bec3ff9b2c793d8f;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=db894da6e40250aae6b90ea2f3774ca79d8b68e8;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/fiberlamp.c b/hacks/fiberlamp.c index db894da6..43157751 100644 --- a/hacks/fiberlamp.c +++ b/hacks/fiberlamp.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* fiberlamp --- A Fiber Optic Lamp */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)fiberlamp.c 5.00 2000/11/01 xlockmore"; #endif @@ -34,7 +34,9 @@ static const char sccsid[] = "@(#)fiberlamp.c 5.00 2000/11/01 xlockmore"; #define DEFAULTS "*delay: 10000 \n" \ "*count: 500 \n" \ "*cycles: 10000 \n" \ - "*ncolors: 64 \n" + "*ncolors: 64 \n" \ + "*fpsTop: true \n" \ + # define UNIFORM_COLORS # define fiberlamp_handle_event 0 # include "xlockmore.h" /* in xscreensaver distribution */ @@ -57,7 +59,7 @@ ModStruct fiberlamp_description = #define SPREAD (30.0) /* Angular spread at the base */ #define SCALE (MI_WIDTH(mi)/2) /* Screen size */ -#define NODES (20) /* Number of nodes in a fiber. Variable with range +#define NODES (20L) /* Number of nodes in a fiber. Variable with range 10 .. 30, if desired. High values have stability problems unless you use small DT */ @@ -93,7 +95,7 @@ typedef struct { int init; double psi; double dpsi; - int count, nfibers; + long count, nfibers; double cx; double rx, ry; /* Coordinates relative to root */ fiberstruct *fiber; @@ -163,7 +165,7 @@ init_fiberlamp(ModeInfo * mi) fl = &fiberlamps[MI_SCREEN(mi)]; /* Create or Resize double buffer */ -#ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ +#ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ fl->dbufp = False; #else fl->dbufp = True; @@ -406,9 +408,9 @@ draw_fiberlamp (ModeInfo * mi) double x = fs->node[1].x - fl->cx + 0.025; double y = fs->node[1].z + 0.02; double angle = atan2(y, x) + fl->psi; - int tipcolor = (int)(MI_NPIXELS(mi)*angle/(2*M_PI)) % MI_NPIXELS(mi); - int fibercolor; - int tiplen; + long tipcolor = (int)(MI_NPIXELS(mi)*angle/(2*M_PI)) % MI_NPIXELS(mi); + long fibercolor; + long tiplen; if (tipcolor < 0) tipcolor += MI_NPIXELS(mi); tipcolor = MI_PIXEL(mi, tipcolor);