Fullscreen, vsync, fullscreen_bpp and fsaa options in the config; fsaa is experimenta...
authorq66 <quaker66@gmail.com>
Tue, 3 Apr 2012 11:59:02 +0000 (13:59 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 7 Apr 2012 20:23:00 +0000 (23:23 +0300)
minetest.conf.example
src/defaultsettings.cpp
src/main.cpp

index edc2222bb143b4a49b8c0bab53059581e126b484..755ddaaee12a8e582d8b4cf77c4dba8f0b1eaf2c 100644 (file)
 # Initial window size
 #screenW = 800
 #screenH = 600
+#fullscreen = false
+#fullscreen_bpp = 24
+# Experimental option, might cause visible spaces between blocks
+# when set to higher number than 0
+#fsaa = 0
+#vsync = false
 # Address to connect to (#blank = start local server)
 #address = 
 # Enable random user input, for testing
index 67f2e4055805b7ca383d57d55d4c532dd35ebf58..ab6866cec76b042c9aa2520c607c23e12549fcfa 100644 (file)
@@ -74,6 +74,10 @@ void set_default_settings(Settings *settings)
        settings->setDefault("viewing_range_nodes_min", "35");
        settings->setDefault("screenW", "800");
        settings->setDefault("screenH", "600");
+       settings->setDefault("fullscreen", "false");
+       settings->setDefault("fullscreen_bpp", "24");
+       settings->setDefault("fsaa", "0");
+       settings->setDefault("vsync", "false");
        settings->setDefault("address", "");
        settings->setDefault("random_input", "false");
        settings->setDefault("client_unload_unused_data_timeout", "600");
index 8a650419470d9fcea57501f0a16454e25bf0606f..8ec4c26321023e9dede1bb4178e5a5f0b30061ab 100644 (file)
@@ -1213,10 +1213,16 @@ int main(int argc, char *argv[])
 
        // Resolution selection
        
-       bool fullscreen = false;
+       bool fullscreen = g_settings->getBool("fullscreen");
        u16 screenW = g_settings->getU16("screenW");
        u16 screenH = g_settings->getU16("screenH");
 
+       // bpp, fsaa, vsync
+
+       bool vsync = g_settings->getBool("vsync");
+       u16 bits = g_settings->getU16("fullscreen_bpp");
+       u16 fsaa = g_settings->getU16("fsaa");
+
        // Determine driver
 
        video::E_DRIVER_TYPE driverType;
@@ -1249,9 +1255,18 @@ int main(int argc, char *argv[])
        MyEventReceiver receiver;
 
        IrrlichtDevice *device;
-       device = createDevice(driverType,
-                       core::dimension2d<u32>(screenW, screenH),
-                       16, fullscreen, false, false, &receiver);
+
+       SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
+       params.DriverType    = driverType;
+       params.WindowSize    = core::dimension2d<u32>(screenW, screenH);
+       params.Bits          = bits;
+       params.AntiAlias     = fsaa;
+       params.Fullscreen    = fullscreen;
+       params.Stencilbuffer = false;
+       params.Vsync         = vsync;
+       params.EventReceiver = &receiver;
+
+       device = createDeviceEx(params);
 
        if (device == 0)
                return 1; // could not create selected driver.