sdl: attempt to detect video resolution for fullscreen during configuration file generation

This commit is contained in:
punkrockguy318 2012-11-25 18:56:53 +00:00
parent f3486b8fdd
commit 9bcf1cc648
1 changed files with 12 additions and 2 deletions

View File

@ -150,10 +150,20 @@ InitConfig()
config->addOption("slstart", "SDL.ScanLineStart", 0);
config->addOption("slend", "SDL.ScanLineEnd", 239);
const SDL_VideoInfo* vid_info = SDL_GetVideoInfo();
// video controls
config->addOption('x', "xres", "SDL.XResolution", 512);
config->addOption('y', "yres", "SDL.YResolution", 448);
config->addOption('f', "fullscreen", "SDL.Fullscreen", 0);
// if we can detect the screen resolultion, use that for the default fullscreen res
if(vid_info != NULL)
{
config->addOption('x', "xres", "SDL.XResolution", vid_info->current_w);
config->addOption('y', "yres", "SDL.YResolution", vid_info->current_h);
}
else
{
config->addOption('x', "xres", "SDL.XResolution", 512);
config->addOption('y', "yres", "SDL.YResolution", 448);
}
config->addOption('b', "bpp", "SDL.BitsPerPixel", 32);
config->addOption("doublebuf", "SDL.DoubleBuffering", 0);
config->addOption("autoscale", "SDL.AutoScale", 1);