else if (st->particles[i].xpos >= st->iWinWidth - 2)
{
st->particles[i].xpos = st->iWinWidth - 2;
+ if (st->particles[i].xpos < 1) st->particles[i].xpos = 1;
st->particles[i].xdir = -st->particles[i].xdir + 4;
st->particles[i].colorindex = st->iColorCount;
}
else if (st->particles[i].ypos >= st->iWinHeight - 3)
{
st->particles[i].ypos = st->iWinHeight- 3;
+ if (st->particles[i].ypos < 1) st->particles[i].ypos = 1;
st->particles[i].ydir = (-st->particles[i].ydir >> 2) - (random() % 2);
st->particles[i].colorindex = st->iColorCount;
}
+
/* st->gravity kicks in */
st->particles[i].ydir += st->gravity;
st->particles[i].colorindex--;
/* draw particle */
+ if (st->iWinHeight <= 2 || st->iWinWidth <= 2) continue;
st->fire[st->particles[i].ypos][st->particles[i].xpos] = st->particles[i].colorindex;
st->fire[st->particles[i].ypos][st->particles[i].xpos - 1] = st->particles[i].colorindex;
st->fire[st->particles[i].ypos + 1][st->particles[i].xpos] = st->particles[i].colorindex;
{
XGCValues gcValues;
XWindowAttributes XWinAttribs;
- int iBitsPerPixel, i;
+ int /*iBitsPerPixel,*/ i;
/* Create the Image for drawing */
XGetWindowAttributes( st->dpy, st->window, &XWinAttribs );
for( i=0; i<pfvc; i++ )
if( pfv[ i ].depth == XWinAttribs.depth )
{
- iBitsPerPixel = pfv[ i ].bits_per_pixel;
+ /*iBitsPerPixel = pfv[ i ].bits_per_pixel;*/
break;
}
if( pfv )
time_t nTime = time( NULL );
unsigned short iFrame = 0;
#endif /* VERBOSE */
- int i;
st->dpy = dpy;
st->window = window;
st->delay = get_integer_resource(st->dpy, "delay", "Integer" );
st->cycles = get_integer_resource(st->dpy, "cycles", "Integer" );
- i = st->cycles;
cache(st);
eruption_reshape (Display *dpy, Window window, void *closure,
unsigned int w, unsigned int h)
{
+#if 0
+ struct state *st = (struct state *) closure;
+ int i;
+ for (i = 0; i < st->iWinHeight; ++i)
+ free (st->fire[i]);
+
+ st->iWinWidth = w;
+ st->iWinHeight = h;
+
+ free (st->fire);
+ st->fire = calloc( st->iWinHeight, sizeof(unsigned char*));
+ for (i = 0; i < st->iWinHeight; ++i)
+ st->fire[i] = calloc( st->iWinWidth, sizeof(unsigned char));
+ st->draw_i = -1;
+#endif
}
static Bool
static const char *eruption_defaults [] = {
".background: black",
".foreground: white",
+ "*fpsTop: true",
"*cycles: 80",
"*ncolors: 256",
"*delay: 10000",