sdl: attempt to detect video resolution for fullscreen during configuration file generation
This commit is contained in:
parent
f3486b8fdd
commit
9bcf1cc648
|
@ -150,10 +150,20 @@ InitConfig()
|
||||||
config->addOption("slstart", "SDL.ScanLineStart", 0);
|
config->addOption("slstart", "SDL.ScanLineStart", 0);
|
||||||
config->addOption("slend", "SDL.ScanLineEnd", 239);
|
config->addOption("slend", "SDL.ScanLineEnd", 239);
|
||||||
|
|
||||||
|
const SDL_VideoInfo* vid_info = SDL_GetVideoInfo();
|
||||||
// video controls
|
// video controls
|
||||||
|
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('x', "xres", "SDL.XResolution", 512);
|
||||||
config->addOption('y', "yres", "SDL.YResolution", 448);
|
config->addOption('y', "yres", "SDL.YResolution", 448);
|
||||||
config->addOption('f', "fullscreen", "SDL.Fullscreen", 0);
|
}
|
||||||
config->addOption('b', "bpp", "SDL.BitsPerPixel", 32);
|
config->addOption('b', "bpp", "SDL.BitsPerPixel", 32);
|
||||||
config->addOption("doublebuf", "SDL.DoubleBuffering", 0);
|
config->addOption("doublebuf", "SDL.DoubleBuffering", 0);
|
||||||
config->addOption("autoscale", "SDL.AutoScale", 1);
|
config->addOption("autoscale", "SDL.AutoScale", 1);
|
||||||
|
|
Loading…
Reference in New Issue