add fullscreen mode to settings

This commit is contained in:
darkrose 2014-09-17 05:34:33 +10:00
parent 0e8defb594
commit 587fc2e639
3 changed files with 37 additions and 7 deletions

View File

@ -66,8 +66,13 @@ void set_default_settings(Settings *settings)
settings->setDefault("fps_max", "60"); settings->setDefault("fps_max", "60");
settings->setDefault("viewing_range_nodes_max", "300"); settings->setDefault("viewing_range_nodes_max", "300");
settings->setDefault("viewing_range_nodes_min", "15"); settings->setDefault("viewing_range_nodes_min", "15");
settings->setDefault("screenW", "800"); settings->setDefault("screenW", "1024");
settings->setDefault("screenH", "600"); settings->setDefault("screenH", "600");
settings->setDefault("fullscreen","false");
settings->setDefault("fullscreen_bpp", "24");
settings->setDefault("fsaa", "0");
settings->setDefault("vsync", "false");
settings->setDefault("high_precision_fpu","true");
settings->setDefault("address", ""); settings->setDefault("address", "");
settings->setDefault("random_input", "false"); settings->setDefault("random_input", "false");
settings->setDefault("client_unload_unused_data_timeout", "600"); settings->setDefault("client_unload_unused_data_timeout", "600");

View File

@ -1002,10 +1002,16 @@ int main(int argc, char *argv[])
// Resolution selection // Resolution selection
bool fullscreen = false; bool fullscreen = g_settings->getBool("fullscreen");
u16 screenW = g_settings->getU16("screenW"); u16 screenW = g_settings->getU16("screenW");
u16 screenH = g_settings->getU16("screenH"); 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 // Determine driver
video::E_DRIVER_TYPE driverType; video::E_DRIVER_TYPE driverType;
@ -1037,10 +1043,23 @@ int main(int argc, char *argv[])
MyEventReceiver receiver; MyEventReceiver receiver;
IrrlichtDevice *device; SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
device = createDevice(driverType, params.DriverType = driverType;
core::dimension2d<u32>(screenW, screenH), params.WindowSize = core::dimension2d<u32>(screenW, screenH);
16, fullscreen, false, false, &receiver); params.Bits = bits;
params.AntiAlias = fsaa;
params.Fullscreen = fullscreen;
params.Stencilbuffer = false;
params.Vsync = vsync;
params.EventReceiver = &receiver;
params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");
IrrlichtDevice * device = createDeviceEx(params);
//IrrlichtDevice *device;
//device = createDevice(driverType,
//core::dimension2d<u32>(screenW, screenH),
//16, fullscreen, false, false, &receiver);
if (device == 0) if (device == 0)
return 1; // could not create selected driver. return 1; // could not create selected driver.

View File

@ -61,8 +61,14 @@
#viewing_range_nodes_max = 300 #viewing_range_nodes_max = 300
#viewing_range_nodes_min = 25 #viewing_range_nodes_min = 25
# Initial window size # Initial window size
#screenW = 800 #screenW = 1024
#screenH = 600 #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 to connect to (#blank = start local server)
#address = #address =
# Enable random user input, for testing # Enable random user input, for testing