X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fsdl%2Fmain.c;h=f2487cfe238b7c60064ecc41416190bc42014691;hp=08bddf800c070078f748ddc239221107299fd20d;hb=e8b26db00c934d141f16652cb8dcbeae23b17e48;hpb=b0159ee29e4e616e4506d3cea5aee6ecc97aa93a diff --git a/src/sdl/main.c b/src/sdl/main.c index 08bddf8..f2487cf 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -41,23 +41,23 @@ int main(int argc, char **argv) printf("Framebuffer scaling x%d\n", fbscale); } - xsz = fb_width * fbscale; - ysz = fb_height * fbscale; + xsz = FB_WIDTH * fbscale; + ysz = FB_HEIGHT * fbscale; /* 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 1 extra row as a guard band, until we fucking fix the rasterizer */ - if(!(fb_pixels = malloc(fb_width * (fb_height + 1) * fb_bpp / CHAR_BIT))) { + if(!(fb_pixels = malloc(FB_WIDTH * (FB_HEIGHT + 1) * FB_BPP / CHAR_BIT))) { fprintf(stderr, "failed to allocate virtual framebuffer\n"); return 1; } #endif SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE); - if(!(fbsurf = SDL_SetVideoMode(xsz, ysz, fb_bpp, sdl_flags))) { - fprintf(stderr, "failed to set video mode %dx%d %dbpp\n", fb_width, fb_height, fb_bpp); + if(!(fbsurf = SDL_SetVideoMode(xsz, ysz, FB_BPP, sdl_flags))) { + fprintf(stderr, "failed to set video mode %dx%d %dbpp\n", FB_WIDTH, FB_HEIGHT, FB_BPP); /*free(fb_pixels);*/ SDL_Quit(); return 1; @@ -134,8 +134,8 @@ void swap_buffers(void *pixels) sptr = fb_pixels; dptr = (unsigned short*)fbsurf->pixels + (fbsurf->w - xsz) / 2; - for(i=0; iw - fb_width) * fbscale; + dptr += (fbsurf->w - FB_WIDTH) * fbscale; } if(SDL_MUSTLOCK(fbsurf)) { @@ -215,7 +215,7 @@ static void toggle_fullscreen(void) SDL_Surface *newsurf; unsigned int newflags = sdl_flags ^ SDL_FULLSCREEN; - if(!(newsurf = SDL_SetVideoMode(xsz, ysz, fb_bpp, newflags))) { + if(!(newsurf = SDL_SetVideoMode(xsz, ysz, FB_BPP, newflags))) { fprintf(stderr, "failed to go %s\n", newflags & SDL_FULLSCREEN ? "fullscreen" : "windowed"); return; }