- static int no_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, D,D,D,D };
- static int up_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, U,U,D,D };
- static int down_bias[] = { L,L,L,L, R,R,R,R, U,U,D,D, D,D,D,D };
- static int left_bias[] = { L,L,L,L, L,L,R,R, U,U,U,U, D,D,D,D };
- static int right_bias[] = { L,L,R,R, R,R,R,R, U,U,U,U, D,D,D,D };
-
- static int upleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,U, U,D,D,D };
- static int downleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,D, D,D,D,D };
- static int upright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,U, U,D,D,D };
- static int downright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,D, D,D,D,D };
- static int *bias;
-
- switch (mode) {
- case SHUFFLE: bias = no_bias; break;
- case UP: bias = up_bias; break;
- case LEFT: bias = left_bias; break;
- case RIGHT: bias = right_bias; break;
- case DOWN: bias = down_bias; break;
- case UPLEFT: bias = upleft_bias; break;
- case DOWNLEFT: bias = downleft_bias; break;
- case UPRIGHT: bias = upright_bias; break;
- case DOWNRIGHT: bias = downright_bias; break;
- case IN: bias = no_bias; break;
- case OUT: bias = no_bias; break;
- case MELT: bias = no_bias; break;
- case STRETCH: bias = no_bias; break;
- case FUZZ: bias = no_bias; break;
+ static const int no_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, D,D,D,D };
+ static const int up_bias[] = { L,L,L,L, R,R,R,R, U,U,U,U, U,U,D,D };
+ static const int down_bias[] = { L,L,L,L, R,R,R,R, U,U,D,D, D,D,D,D };
+ static const int left_bias[] = { L,L,L,L, L,L,R,R, U,U,U,U, D,D,D,D };
+ static const int right_bias[] = { L,L,R,R, R,R,R,R, U,U,U,U, D,D,D,D };
+
+ static const int upleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,U, U,D,D,D };
+ static const int downleft_bias[] = { L,L,L,L, L,R,R,R, U,U,U,D, D,D,D,D };
+ static const int upright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,U, U,D,D,D };
+ static const int downright_bias[] = { L,L,L,R, R,R,R,R, U,U,U,D, D,D,D,D };
+
+ if (st->img_loader) /* still loading */
+ {
+ st->img_loader = load_image_async_simple (st->img_loader,
+ 0, 0, 0, 0, 0);
+ if (! st->img_loader) { /* just finished */
+
+ st->start_time = time ((time_t) 0);
+ if (st->random_p)
+ st->mode = random() % (FUZZ+1);
+
+ if (st->mode == MELT || st->mode == STRETCH)
+ /* make sure screen eventually turns background color */
+ XDrawLine (st->dpy, st->window, st->gc, 0, 0, st->sizex, 0);
+ }
+ return st->delay;
+ }
+
+ if (!st->img_loader &&
+ st->start_time + st->duration < time ((time_t) 0)) {
+ decayscreen_load_image (st);
+ }
+
+ switch (st->mode) {
+ case SHUFFLE: st->current_bias = no_bias; break;
+ case UP: st->current_bias = up_bias; break;
+ case LEFT: st->current_bias = left_bias; break;
+ case RIGHT: st->current_bias = right_bias; break;
+ case DOWN: st->current_bias = down_bias; break;
+ case UPLEFT: st->current_bias = upleft_bias; break;
+ case DOWNLEFT: st->current_bias = downleft_bias; break;
+ case UPRIGHT: st->current_bias = upright_bias; break;
+ case DOWNRIGHT: st->current_bias = downright_bias; break;
+ case IN: st->current_bias = no_bias; break;
+ case OUT: st->current_bias = no_bias; break;
+ case MELT: st->current_bias = no_bias; break;
+ case STRETCH: st->current_bias = no_bias; break;
+ case FUZZ: st->current_bias = no_bias; break;