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);
15 struct screen *metaballs_screen(void);
16 struct screen *greets_screen(void);
19 static struct screen *scr[NUM_SCR];
20 static int num_screens;
22 static struct screen *cur, *prev, *next;
23 static long trans_start, trans_dur;
29 if(!(scr[idx++] = tunnel_screen())) {
32 if(!(scr[idx++] = fract_screen())) {
35 if (!(scr[idx++] = grise_screen())) {
38 if(!(scr[idx++] = polytest_screen())) {
41 if (!(scr[idx++] = plasma_screen())) {
44 if (!(scr[idx++] = bump_screen())) {
47 if (!(scr[idx++] = thunder_screen())) {
50 if(!(scr[idx++] = metaballs_screen())) {
53 if(!(scr[idx++] = greets_screen())) {
58 assert(num_screens <= NUM_SCR);
60 for(i=0; i<num_screens; i++) {
61 if(scr[i]->init() == -1) {
68 void scr_shutdown(void)
71 for(i=0; i<num_screens; i++) {
78 if(prev) { /* we're in the middle of a transition */
79 long interval = time_msec - trans_start;
80 if(interval >= trans_dur) {
82 next->start(trans_dur);
96 struct screen *scr_lookup(const char *name)
99 for(i=0; i<num_screens; i++) {
100 if(strcmp(scr[i]->name, name) == 0) {
107 struct screen *scr_screen(int idx)
112 int scr_num_screens(void)
117 int scr_change(struct screen *s, long trans_time)
120 if(s == cur) return 0;
123 trans_dur = trans_time / 2; /* half for each part transition out then in */
124 trans_start = time_msec;
129 if(cur && cur->stop) {
130 cur->stop(trans_dur);