X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdemo.c;h=4bd02c7405d039f3ee2844d05955e58c0267f124;hp=32f764c5a831be3ffdd8ca64a7587cfcb1c6d872;hb=77c1d84c258ca14e1bba06ab711426668ff24290;hpb=8a64d603ee67cd98070360b40938e123ea845154 diff --git a/src/demo.c b/src/demo.c index 32f764c..4bd02c7 100644 --- a/src/demo.c +++ b/src/demo.c @@ -4,22 +4,30 @@ #include #include #include "demo.h" +#include "screen.h" -int fbwidth = 320; -int fbheight = 240; -int fbbpp = 8; -unsigned char *fbpixels; +int fb_width = 320; +int fb_height = 240; +int fb_bpp = 16; +unsigned char *fb_pixels; unsigned long time_msec; static unsigned long nframes; int demo_init(int argc, char **argv) { + if(scr_init() == -1) { + return -1; + } + scr_change(scr_lookup("tunnel"), 4000); + return 0; } void demo_cleanup(void) { + scr_shutdown(); + if(time_msec) { float fps = (float)nframes / ((float)time_msec / 1000.0f); printf("average framerate: %.1f\n", fps); @@ -28,16 +36,8 @@ void demo_cleanup(void) void demo_draw(void) { - int i, j; - unsigned char *fbptr = fbpixels; - - for(i=0; i