X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fscreen.c;h=b39778d52d7331ff64ed0bbbb8914230a79ba2f5;hp=c91cb82ad2ce6df871418a03aa5bb74064aa74ad;hb=fcac764d752234a03df536dd408235170394f6ad;hpb=a8d502c1e163a95f25b2f5aec1478d2cb61027c2 diff --git a/src/screen.c b/src/screen.c index c91cb82..b39778d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -10,6 +10,12 @@ struct screen *fract_screen(void); struct screen *grise_screen(void); struct screen *polytest_screen(void); struct screen *plasma_screen(void); +struct screen *bump_screen(void); +struct screen *thunder_screen(void); +struct screen *metaballs_screen(void); +struct screen *greets_screen(void); +struct screen *infcubes_screen(void); +struct screen *hairball_screen(void); #define NUM_SCR 32 static struct screen *scr[NUM_SCR]; @@ -37,25 +43,32 @@ int scr_init(void) if (!(scr[idx++] = plasma_screen())) { return -1; } + if (!(scr[idx++] = bump_screen())) { + return -1; + } + if (!(scr[idx++] = thunder_screen())) { + return -1; + } + if(!(scr[idx++] = metaballs_screen())) { + return -1; + } + if(!(scr[idx++] = greets_screen())) { + return -1; + } + if(!(scr[idx++] = infcubes_screen())) { + return -1; + } + if(!(scr[idx++] = hairball_screen())) { + return -1; + } num_screens = idx; assert(num_screens <= NUM_SCR); for(i=0; iinit(); - if(r == -1) { + if(scr[i]->init() == -1) { return -1; } - - /* Make the effect run first if it returns "CAFE" from ins init() */ - if (r == 0xCAFE) { - struct screen *tmp; - tmp = scr[i]; - scr[i] = scr[0]; - scr[0] = tmp; - printf("*** Screen %s displayed out of order ***\n", scr[0]->name); - } } return 0; } @@ -88,6 +101,13 @@ void scr_draw(void) if(cur) cur->draw(); } +void scr_keypress(int key) +{ + if(cur && cur->keypress) { + cur->keypress(key); + } +} + struct screen *scr_lookup(const char *name) { int i;