8 struct screen *tunnel_screen(void);
9 struct screen *fract_screen(void);
10 struct screen *grise_screen(void);
13 static struct screen *scr[NUM_SCR];
14 static int num_screens;
16 static struct screen *cur, *prev, *next;
17 static long trans_start, trans_dur;
23 if(!(scr[idx++] = tunnel_screen())) {
26 if(!(scr[idx++] = fract_screen())) {
29 if (!(scr[idx++] = grise_screen())) {
34 assert(num_screens <= NUM_SCR);
36 for(i=0; i<num_screens; i++) {
43 /* Make the effect run first if it returns "CAFE" from ins init() */
49 printf("*** Screen %s displayed out of order ***\n", scr[0]->name);
55 void scr_shutdown(void)
58 for(i=0; i<num_screens; i++) {
65 if(prev) { /* we're in the middle of a transition */
66 long interval = time_msec - trans_start;
67 if(interval >= trans_dur) {
69 next->start(trans_dur);
83 struct screen *scr_lookup(const char *name)
86 for(i=0; i<num_screens; i++) {
87 if(strcmp(scr[i]->name, name) == 0) {
94 struct screen *scr_screen(int idx)
99 int scr_num_screens(void)
104 int scr_change(struct screen *s, long trans_time)
107 if(s == cur) return 0;
110 trans_dur = trans_time / 2; /* half for each part transition out then in */
111 trans_start = time_msec;
118 cur->stop(trans_dur);