7 struct screen *console_screen(void);
8 struct screen *tunnel_screen(void);
11 static struct screen *scr[NUM_SCR];
13 static struct screen *cur, *prev, *next;
14 static long trans_start, trans_dur;
20 if(!(scr[0] = console_screen())) {
23 if(!(scr[1] = tunnel_screen())) {
27 for(i=0; i<NUM_SCR; i++) {
28 if(scr[i]->init() == -1) {
35 void scr_shutdown(void)
38 for(i=0; i<NUM_SCR; i++) {
45 if(prev) { /* we're in the middle of a transition */
46 long interval = time_msec - trans_start;
47 if(interval >= trans_dur) {
48 next->start(trans_dur);
61 struct screen *scr_lookup(const char *name)
64 for(i=0; i<NUM_SCR; i++) {
65 if(strcmp(scr[i]->name, name) == 0) {
72 int scr_change(struct screen *s, long trans_time)
75 if(s == cur) return 0;
77 if(trans_time && cur) {
78 trans_dur = trans_time / 2; /* half for each part transition out then in */
79 trans_start = time_msec;
81 if(cur) cur->stop(trans_dur);