init on screen center on first startup

This commit is contained in:
Eduardo Bart
2011-03-20 19:10:02 -03:00
parent 2339e05b34
commit caded3285c
4 changed files with 25 additions and 6 deletions

View File

@@ -48,10 +48,16 @@ void signal_handler(int sig)
/// Default configurations
void setDefaultConfigs()
{
g_config.setValue("window x", 0);
g_config.setValue("window y", 0);
g_config.setValue("window width", 640);
g_config.setValue("window height", 480);
// default size
int defWidth = 640;
int defHeight = 480;
// init on screen center
g_config.setValue("window x", (Platform::getDisplayWidth() - defWidth)/2);
g_config.setValue("window y", (Platform::getDisplayHeight() - defHeight)/2);
g_config.setValue("window width", defWidth);
g_config.setValue("window height", defHeight);
g_config.setValue("window maximized", false);
}