*/
Settings main_settings;
Settings *g_settings = &main_settings;
+std::string g_settings_path;
// Global profiler
Profiler main_profiler;
*/
if(noMenuActive() == false)
{
- return false;
+ return g_menumgr.preprocessEvent(event);
}
// Remember whether each key is down or up
*/
// Path of configuration file in use
- std::string configpath = "";
+ g_settings_path = "";
if(cmd_args.exists("config"))
{
<<cmd_args.get("config")<<"\""<<std::endl;
return 1;
}
- configpath = cmd_args.get("config");
+ g_settings_path = cmd_args.get("config");
}
else
{
bool r = g_settings->readConfigFile(filenames[i].c_str());
if(r)
{
- configpath = filenames[i];
+ g_settings_path = filenames[i];
break;
}
}
// If no path found, use the first one (menu creates the file)
- if(configpath == "")
- configpath = filenames[0];
+ if(g_settings_path == "")
+ g_settings_path = filenames[0];
}
// Initialize debug streams
verbosestream<<_("Using gameid")<<" ["<<gamespec.id<<"]"<<std::endl;
// Create server
- Server server(world_path, configpath, gamespec, false);
+ Server server(world_path, gamespec, false);
server.start(port);
// Run server
params.Stencilbuffer = false;
params.Vsync = vsync;
params.EventReceiver = &receiver;
+ params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");
nulldevice = createDeviceEx(params);
params.Stencilbuffer = false;
params.Vsync = vsync;
params.EventReceiver = &receiver;
+ params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu");
device = createDeviceEx(params);
// Initialize menu data
MainMenuData menudata;
- menudata.kill = kill;
menudata.address = address;
menudata.name = playername;
menudata.port = itos(port);
}
infostream<<"Waited for other menus"<<std::endl;
- GUIEngine* temp = new GUIEngine(device, guiroot, &g_menumgr,smgr,&menudata);
+ GUIEngine* temp = new GUIEngine(device, guiroot, &g_menumgr,smgr,&menudata,kill);
delete temp;
//once finished you'll never end up here
smgr->clear();
- kill = menudata.kill;
+ }
+ if(menudata.errormessage != ""){
+ error_message = narrow_to_wide(menudata.errormessage);
+ continue;
}
//update worldspecs (necessary as new world may have been created)
// Break out of menu-game loop to shut down cleanly
if(device->run() == false || kill == true) {
- g_settings->updateConfigFile(configpath.c_str());
+ if(g_settings_path != "") {
+ g_settings->updateConfigFile(
+ g_settings_path.c_str());
+ }
break;
}
current_address,
current_port,
error_message,
- configpath,
chat_backend,
gamespec,
simple_singleplayer_mode
#endif // !SERVER
// Update configuration file
- if(configpath != "")
- g_settings->updateConfigFile(configpath.c_str());
+ if(g_settings_path != "")
+ g_settings->updateConfigFile(g_settings_path.c_str());
// Print modified quicktune values
{