Commit afa113f1 authored by Evan Ramos's avatar Evan Ramos
Browse files

Use the user's desktop resolution, fullscreen, as the default, instead of 1024x768 windowed.

From-SVN: r6704
parent 1e50ebdb
......@@ -474,7 +474,11 @@ int main(int argc, char *argv[])
#elif defined(HAVE_GTK2)
// Pre-initialize SDL video system in order to make sure XInitThreads() is called
// before GTK starts talking to X11.
SDL_Init(SDL_INIT_VIDEO);
uint32_t inited = SDL_WasInit(SDL_INIT_VIDEO);
if (inited == 0)
SDL_Init(SDL_INIT_VIDEO);
else if (!(inited & SDL_INIT_VIDEO))
SDL_InitSubSystem(SDL_INIT_VIDEO);
gtkbuild_init(&argc, &argv);
#endif
......@@ -597,7 +601,14 @@ int32_t initsystem(void)
if (sdlayer_checkversion())
return -1;
if (SDL_Init(sdlinitflags))
int32_t err = 0;
uint32_t inited = SDL_WasInit(sdlinitflags);
if (inited == 0)
err = SDL_Init(sdlinitflags);
else if ((inited & sdlinitflags) != sdlinitflags)
err = SDL_InitSubSystem(sdlinitflags & ~inited);
if (err)
{
initprintf("Initialization failed! (%s)\nNon-interactive mode enabled\n", SDL_GetError());
novideo = 1;
......
......@@ -133,6 +133,10 @@ void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN])
}
}
#if defined SDL_TARGET && SDL_TARGET > 1
# include "sdl_inc.h"
#endif
void CONFIG_SetDefaults(void)
{
// JBF 20031211
......@@ -152,11 +156,28 @@ void CONFIG_SetDefaults(void)
ud.config.ScreenWidth = droidinfo.screen_width;
ud.config.ScreenHeight = droidinfo.screen_height;
#else
ud.config.ScreenWidth = 1024;
ud.config.ScreenHeight = 768;
# if defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
uint32_t inited = SDL_WasInit(SDL_INIT_VIDEO);
if (inited == 0)
SDL_Init(SDL_INIT_VIDEO);
else if (!(inited & SDL_INIT_VIDEO))
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_DisplayMode dm;
if (SDL_GetDesktopDisplayMode(0, &dm) == 0)
{
ud.config.ScreenWidth = dm.w;
ud.config.ScreenHeight = dm.h;
}
else
# endif
{
ud.config.ScreenWidth = 1024;
ud.config.ScreenHeight = 768;
}
#endif
ud.config.ScreenMode = 0;
ud.config.ScreenMode = 1;
#ifdef USE_OPENGL
ud.config.ScreenBPP = 32;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment