- current_time = get_integer_resource("start_time", "Integer");
- if (info->whirlies == -1)
- info->whirlies = 1 + (random() % 15);
- if (info->nlines == -1)
- info->nlines = 1 + (random() % 5);
- if (info->color_modifier == -1)
- info->color_modifier = 1 + (random() % 25);
- if (get_boolean_resource("explain", "Integer"))
- explain(xmode, ymode, info, display, window, fgc);
- current_color = 1 + (random() % NCOLORS);
- /* Now that info is full, lets play! */
-
- while (1) {
- int wcount; /* wcount is a counter incremented for every whirly take note of
- internal_time before you mess with it */
- int change_time = 4000;
- if (! strcmp (xmode_str, "change") && ! strcmp (ymode_str, "change")) {
- if ((current_time - start_time) > change_time) {
- start_time = current_time;
- xmode = 1 + (random() % 4);
- ymode = 1 + (random() % 4);
- }
+ /* I want the distance between whirlies to increase more each whirly */
+ internal_time = st->current_time + (10 * wcount) + (wcount * wcount);
+ switch (st->xmode) {
+ /* All these functions expect an int time, the struct info,
+ a pointer to an array of positions, and the index that the
+ the function will fill of the array */
+ case spin_mode:
+ spin(st, internal_time, st->info, st->pos, 0);
+ break;
+ case funky_mode:
+ funky(st, internal_time, st->info, st->pos, 0);
+ break;
+ case circle_mode:
+ circle(st, internal_time, st->info, st->pos, 0);
+ break;
+ case linear_mode:
+ linear(st, internal_time, st->info, st->pos, 0);
+ break;
+ case fun_mode:
+ fun(st, internal_time, st->info, st->pos, 0);
+ break;
+ case test_mode:
+ test(st, internal_time, st->info, st->pos, 0);
+ break;
+ case innie_mode:
+ innie(st, internal_time, st->info, st->pos, 0, st->modifier);
+ break;
+ case lissajous_mode:
+ lissajous(st, internal_time, st->info, st->pos, 0);
+ break;
+ default:
+ spin(st, internal_time, st->info, st->pos, 0);
+ break;
+ } /* End of the switch for the x position*/
+ switch (st->ymode) {
+ case spin_mode:
+ spin(st, internal_time, st->info, st->pos, 1);
+ break;
+ case funky_mode:
+ funky(st, internal_time, st->info, st->pos, 1);
+ break;
+ case circle_mode:
+ circle(st, internal_time, st->info, st->pos, 1);
+ break;
+ case linear_mode:
+ linear(st, internal_time, st->info, st->pos, 1);
+ break;
+ case fun_mode:
+ fun(st, internal_time, st->info, st->pos, 1);
+ break;
+ case test_mode:
+ test(st, internal_time, st->info, st->pos, 1);
+ break;
+ case innie_mode:
+ innie(st, internal_time, st->info, st->pos, 1, st->modifier);
+ break;
+ case lissajous_mode:
+ lissajous(st, internal_time, st->info, st->pos, 1);
+ break;
+ default:
+ spin(st, internal_time, st->info, st->pos, 1);
+ break;
+ } /* End of the switch for the y position*/
+ for (lcount = 0; lcount < st->info->nlines; lcount++) {
+ double arg = (double)((internal_time * st->info->offset_period) / 90.0);
+ double line_offset = 20.0 * (double)lcount * sin(arg);
+ int size;
+ size = (int)(15.0 + 5.0 * sin((double)internal_time / 180.0));
+ /* First delete the old circle... */
+ if (!st->info->trail
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ && ( !st->dbeclear_p || !st->backb)
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ ) {
+ XSetForeground(st->dpy, st->bgc, BlackPixel(st->dpy, st->screen));
+ XFillArc(st->dpy, st->b, st->bgc, st->last_x[wcount][lcount], st->last_y[wcount][lcount], st->last_size[wcount][lcount], st->last_size[wcount][lcount], START_ARC, END_ARC);
+ }
+ /* Now, lets draw in the new circle */
+ { /* Starting new scope for local x_pos and y_pos */
+ int xpos, ypos;
+ if (st->wrap) {
+ xpos = preen((int)(st->info->xoffset*line_offset)+st->pos[0], st->info->half_width * 2);
+ ypos = preen((int)(st->info->yoffset*line_offset)+st->pos[1], st->info->half_height * 2);