8 struct screen *tunnel_screen(void);
9 struct screen *fract_screen(void);
12 static struct screen *scr[NUM_SCR];
13 static int num_screens;
15 static struct screen *cur, *prev, *next;
16 static long trans_start, trans_dur;
22 if(!(scr[idx++] = tunnel_screen())) {
25 if(!(scr[idx++] = fract_screen())) {
30 assert(num_screens <= NUM_SCR);
32 for(i=0; i<num_screens; i++) {
33 if(scr[i]->init() == -1) {
40 void scr_shutdown(void)
43 for(i=0; i<num_screens; i++) {
50 if(prev) { /* we're in the middle of a transition */
51 long interval = time_msec - trans_start;
52 if(interval >= trans_dur) {
54 next->start(trans_dur);
68 struct screen *scr_lookup(const char *name)
71 for(i=0; i<num_screens; i++) {
72 if(strcmp(scr[i]->name, name) == 0) {
79 struct screen *scr_screen(int idx)
84 int scr_num_screens(void)
89 int scr_change(struct screen *s, long trans_time)
92 if(s == cur) return 0;
95 trans_dur = trans_time / 2; /* half for each part transition out then in */
96 trans_start = time_msec;
103 cur->stop(trans_dur);