8 struct screen *tunnel_screen(void);
9 struct screen *fract_screen(void);
10 struct screen *mike_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++] = mike_screen())) {
34 assert(num_screens <= NUM_SCR);
36 for(i=0; i<num_screens; i++) {
37 if(scr[i]->init() == -1) {
44 void scr_shutdown(void)
47 for(i=0; i<num_screens; i++) {
54 if(prev) { /* we're in the middle of a transition */
55 long interval = time_msec - trans_start;
56 if(interval >= trans_dur) {
58 next->start(trans_dur);
72 struct screen *scr_lookup(const char *name)
75 for(i=0; i<num_screens; i++) {
76 if(strcmp(scr[i]->name, name) == 0) {
83 struct screen *scr_screen(int idx)
88 int scr_num_screens(void)
93 int scr_change(struct screen *s, long trans_time)
96 if(s == cur) return 0;
99 trans_dur = trans_time / 2; /* half for each part transition out then in */
100 trans_start = time_msec;
107 cur->stop(trans_dur);