X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Fmain.c;h=4d2f7facee112df05911823b57b363f113c279bd;hp=aed12e98feaec4fe8b245b839ad12697828c8abb;hb=7cffbf057545fb303ad8f53e432ef42f7708e16d;hpb=772dfe62feafd0583e52326c7419ef01e04cac60 diff --git a/src/dos/main.c b/src/dos/main.c index aed12e9..4d2f7fa 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -15,6 +15,7 @@ #include "cfgopt.h" #include "logger.h" #include "tinyfps.h" +#include "cdpmi.h" #undef NOKEYB @@ -31,6 +32,10 @@ static quat_t rot = {0, 0, 0, 1}; int main(int argc, char **argv) { +#ifdef __DJGPP__ + __djgpp_nearptr_enable(); +#endif + fbsize = fb_width * fb_height * fb_bpp / 8; init_logger("demo.log"); @@ -46,12 +51,17 @@ int main(int argc, char **argv) set_mouse(fb_width / 2, fb_height / 2); } + /* now start_loadscr sets up fb_pixels to the space used by the loading image, + * so no need to allocate another framebuffer + */ +#if 0 /* allocate a couple extra rows as a guard band, until we fucking fix the rasterizer */ if(!(fb_pixels = malloc(fbsize + (fb_width * fb_bpp / 8) * 2))) { fprintf(stderr, "failed to allocate backbuffer\n"); return 1; } fb_pixels += fb_width; +#endif if(!(vmem = set_video_mode(fb_width, fb_height, fb_bpp, 1))) { return 1; @@ -119,11 +129,12 @@ void swap_buffers(void *pixels) pixels = fb_pixels; } + demo_post_draw(pixels); + /* just memcpy to the front buffer */ if(opt.vsync) { wait_vsync(); } - drawFps(pixels); memcpy(vmem, pixels, fbsize); }