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);
13 struct screen *bump_screen(void);
14 struct screen *thunder_screen(void);
17 static struct screen *scr[NUM_SCR];
18 static int num_screens;
20 static struct screen *cur, *prev, *next;
21 static long trans_start, trans_dur;
27 if(!(scr[idx++] = tunnel_screen())) {
30 if(!(scr[idx++] = fract_screen())) {
33 if (!(scr[idx++] = grise_screen())) {
36 if(!(scr[idx++] = polytest_screen())) {
39 if (!(scr[idx++] = plasma_screen())) {
42 if (!(scr[idx++] = bump_screen())) {
45 if (!(scr[idx++] = thunder_screen())) {
50 assert(num_screens <= NUM_SCR);
52 for(i=0; i<num_screens; i++) {
53 if(scr[i]->init() == -1) {
60 void scr_shutdown(void)
63 for(i=0; i<num_screens; i++) {
70 if(prev) { /* we're in the middle of a transition */
71 long interval = time_msec - trans_start;
72 if(interval >= trans_dur) {
74 next->start(trans_dur);
88 struct screen *scr_lookup(const char *name)
91 for(i=0; i<num_screens; i++) {
92 if(strcmp(scr[i]->name, name) == 0) {
99 struct screen *scr_screen(int idx)
104 int scr_num_screens(void)
109 int scr_change(struct screen *s, long trans_time)
112 if(s == cur) return 0;
115 trans_dur = trans_time / 2; /* half for each part transition out then in */
116 trans_start = time_msec;
121 if(cur && cur->stop) {
122 cur->stop(trans_dur);