8 struct screen *tunnel_screen(void);
9 struct screen *fract_screen(void);
10 struct screen *grise_screen(void);
11 struct screen *polytest_screen(void);
12 struct screen *plasma_screen(void);
15 static struct screen *scr[NUM_SCR];
16 static int num_screens;
18 static struct screen *cur, *prev, *next;
19 static long trans_start, trans_dur;
25 if(!(scr[idx++] = tunnel_screen())) {
28 if(!(scr[idx++] = fract_screen())) {
31 if (!(scr[idx++] = grise_screen())) {
34 if(!(scr[idx++] = polytest_screen())) {
37 if (!(scr[idx++] = plasma_screen())) {
42 assert(num_screens <= NUM_SCR);
44 for(i=0; i<num_screens; i++) {
45 if(scr[i]->init() == -1) {
52 void scr_shutdown(void)
55 for(i=0; i<num_screens; i++) {
62 if(prev) { /* we're in the middle of a transition */
63 long interval = time_msec - trans_start;
64 if(interval >= trans_dur) {
66 next->start(trans_dur);
80 struct screen *scr_lookup(const char *name)
83 for(i=0; i<num_screens; i++) {
84 if(strcmp(scr[i]->name, name) == 0) {
91 struct screen *scr_screen(int idx)
96 int scr_num_screens(void)
101 int scr_change(struct screen *s, long trans_time)
104 if(s == cur) return 0;
107 trans_dur = trans_time / 2; /* half for each part transition out then in */
108 trans_start = time_msec;
113 if(cur && cur->stop) {
114 cur->stop(trans_dur);