win32 preferences, bug fixes

This commit is contained in:
Henrique Santiago
2011-03-20 16:55:12 -03:00
parent 7ab8b17bf6
commit e0cfab3dd2
4 changed files with 67 additions and 23 deletions

View File

@@ -48,14 +48,20 @@ void signal_handler(int sig)
/// Default configurations
void setDefaultConfigs()
{
g_config.setValue("width", 640);
g_config.setValue("height", 480);
g_config.setValue("window x", 0);
g_config.setValue("window y", 0);
g_config.setValue("window width", 640);
g_config.setValue("window height", 480);
g_config.setValue("window maximized", false);
}
void saveConfigs()
{
g_config.setValue("width", Platform::getWindowWidth());
g_config.setValue("height", Platform::getWindowHeight());
g_config.setValue("window x", Platform::getWindowX());
g_config.setValue("window y", Platform::getWindowY());
g_config.setValue("window width", Platform::getWindowWidth());
g_config.setValue("window height", Platform::getWindowHeight());
g_config.setValue("window maximized", Platform::isWindowMaximized());
g_config.save();
}
@@ -84,7 +90,10 @@ int main(int argc, const char *argv[])
Platform::init();
// create the window
Platform::createWindow(0, 0, g_config.getInteger("width"), g_config.getInteger("height"), 640, 480, false);
Platform::createWindow(g_config.getInteger("window x"), g_config.getInteger("window y"),
g_config.getInteger("window width"), g_config.getInteger("window height"),
640, 480,
g_config.getBoolean("window maximized"));
Platform::setWindowTitle("OTClient");
Platform::setVsync();