fixed 16bpp offsets in csprite generator (hardcoded for now)
[dosdemo] / src / screen.c
index fb89206..68a8c7f 100644 (file)
@@ -14,6 +14,8 @@ 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];
@@ -53,6 +55,12 @@ int scr_init(void)
        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);
@@ -88,9 +96,22 @@ void scr_update(void)
        }
 }
 
+
 void scr_draw(void)
 {
-       if(cur) cur->draw();
+       if(cur) {
+               cur->draw();
+
+               /* print screen name */
+               cs_puts(fb_pixels, 0, 0, cur->name);
+       }
+}
+
+void scr_keypress(int key)
+{
+       if(cur && cur->keypress) {
+               cur->keypress(key);
+       }
 }
 
 struct screen *scr_lookup(const char *name)