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);
16 static struct screen *scr[NUM_SCR];
17 static int num_screens;
19 static struct screen *cur, *prev, *next;
20 static long trans_start, trans_dur;
26 if(!(scr[idx++] = tunnel_screen())) {
29 if(!(scr[idx++] = fract_screen())) {
32 if (!(scr[idx++] = grise_screen())) {
35 if(!(scr[idx++] = polytest_screen())) {
38 if (!(scr[idx++] = plasma_screen())) {
41 if (!(scr[idx++] = bump_screen())) {
46 assert(num_screens <= NUM_SCR);
48 for(i=0; i<num_screens; i++) {
49 if(scr[i]->init() == -1) {
56 void scr_shutdown(void)
59 for(i=0; i<num_screens; i++) {
66 if(prev) { /* we're in the middle of a transition */
67 long interval = time_msec - trans_start;
68 if(interval >= trans_dur) {
70 next->start(trans_dur);
84 struct screen *scr_lookup(const char *name)
87 for(i=0; i<num_screens; i++) {
88 if(strcmp(scr[i]->name, name) == 0) {
95 struct screen *scr_screen(int idx)
100 int scr_num_screens(void)
105 int scr_change(struct screen *s, long trans_time)
108 if(s == cur) return 0;
111 trans_dur = trans_time / 2; /* half for each part transition out then in */
112 trans_start = time_msec;
117 if(cur && cur->stop) {
118 cur->stop(trans_dur);