static const char *shadebobs_defaults [] = {
".background: black",
".foreground: white",
+ "*fpsSolid: true",
"*degrees: 0", /* default: Automatic degree calculation */
"*color: random",
"*count: 4",
"*cycles: 10",
"*ncolors: 64", /* changing this doesn't work particularly well */
- "*delay: 5000",
+ "*delay: 10000",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+#endif
0
};
pShadeBob->nAngle += pShadeBob->nAngleInc;
pShadeBob->nAngleDelta -= pShadeBob->nAngleInc;
- if( pShadeBob->nAngle >= st->iDegreeCount ) pShadeBob->nAngle -= st->iDegreeCount;
- else if( pShadeBob->nAngle < 0 ) pShadeBob->nAngle += st->iDegreeCount;
+ /* Since it can happen that nAngle < 0 and nAngle + iDegreeCount >= iDegreeCount
+ on floating point, we set some marginal value.
+ */
+ if( pShadeBob->nAngle + 0.5 >= st->iDegreeCount ) pShadeBob->nAngle -= st->iDegreeCount;
+ else if( pShadeBob->nAngle < -0.5 ) pShadeBob->nAngle += st->iDegreeCount;
if( ( pShadeBob->nAngleInc>0.0F && pShadeBob->nAngleDelta<pShadeBob->nAngleInc ) ||
( pShadeBob->nAngleInc<=0.0F && pShadeBob->nAngleDelta>pShadeBob->nAngleInc ) )
{
XGCValues gcValues;
XWindowAttributes XWinAttribs;
- int iBitsPerPixel;
+ /*int iBitsPerPixel;*/
/* Create the Image for drawing */
XGetWindowAttributes( st->dpy, st->window, &XWinAttribs );
- /* Find the preferred bits-per-pixel. (jwz) */
+#if 0
+ /* Find the preferred bits-per-pixel. (jwz) */
{
int i, pfvc = 0;
XPixmapFormatValues *pfv = XListPixmapFormats( st->dpy, &pfvc );
if( pfv )
XFree (pfv);
}
+#endif
/* Create the GC. */
st->gc = XCreateGC( st->dpy, st->window, 0, &gcValues );
else if( st->iDegreeCount > 5400 ) st->iDegreeCount = 5400;
CreateTables( st, st->iDegreeCount );
#ifdef VERBOSE
- printf( "%s: Using a %d degree circle.\n", progname );
+ printf( "%s: Using a %d degree circle.\n", progname, st->iDegreeCount );
#endif /* VERBOSE */
/* Get the base color. */
for( st->iShadeBob=0; st->iShadeBob<st->nShadeBobCount; st->iShadeBob++ )
Execute( st, &st->aShadeBobs[ st->iShadeBob ] );
-#ifdef VERBOSE
- iFrame++;
- if( nTime - time( NULL ) )
- {
- printf( "%s: %d FPS\n", progname, iFrame );
- nTime = time( NULL );
- iFrame = 0;
- }
-#endif /* VERBOSE */
-
return st->delay;
}