diff options
Diffstat (limited to 'src/client/clientlauncher.cpp')
-rw-r--r-- | src/client/clientlauncher.cpp | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index bad5c384c..404a16310 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -89,7 +89,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args) if (list_video_modes) return print_video_modes(); - if (!init_engine(game_params.log_level)) { + if (!init_engine()) { errorstream << "Could not initialize game engine." << std::endl; return false; } @@ -201,6 +201,9 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args) bool game_has_run = launch_game(error_message, reconnect_requested, game_params, cmd_args); + // Reset the reconnect_requested flag + reconnect_requested = false; + // If skip_main_menu, we only want to startup once if (skip_main_menu && !first_loop) break; @@ -321,10 +324,10 @@ void ClientLauncher::init_args(GameParams &game_params, const Settings &cmd_args || cmd_args.getFlag("random-input"); } -bool ClientLauncher::init_engine(int log_level) +bool ClientLauncher::init_engine() { receiver = new MyEventReceiver(); - create_engine_device(log_level); + create_engine_device(); return device != NULL; } @@ -336,6 +339,7 @@ bool ClientLauncher::launch_game(std::string &error_message, MainMenuData menudata; menudata.address = address; menudata.name = playername; + menudata.password = password; menudata.port = itos(game_params.socket_port); menudata.script_data.errormessage = error_message; menudata.script_data.reconnect_requested = reconnect_requested; @@ -455,7 +459,7 @@ bool ClientLauncher::launch_game(std::string &error_message, if (game_params.game_spec.isValid() && game_params.game_spec.id != worldspec.gameid) { - errorstream << "WARNING: Overriding gamespec from \"" + warningstream << "Overriding gamespec from \"" << worldspec.gameid << "\" to \"" << game_params.game_spec.id << "\"" << std::endl; gamespec = game_params.game_spec; @@ -500,20 +504,8 @@ void ClientLauncher::main_menu(MainMenuData *menudata) smgr->clear(); /* leave scene manager in a clean state */ } -bool ClientLauncher::create_engine_device(int log_level) +bool ClientLauncher::create_engine_device() { - static const irr::ELOG_LEVEL irr_log_level[5] = { - ELL_NONE, - ELL_ERROR, - ELL_WARNING, - ELL_INFORMATION, -#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8) - ELL_INFORMATION -#else - ELL_DEBUG -#endif - }; - // Resolution selection bool fullscreen = g_settings->getBool("fullscreen"); u16 screenW = g_settings->getU16("screenW"); @@ -524,6 +516,9 @@ bool ClientLauncher::create_engine_device(int log_level) u16 bits = g_settings->getU16("fullscreen_bpp"); u16 fsaa = g_settings->getU16("fsaa"); + // stereo buffer required for pageflip stereo + bool stereo_buffer = g_settings->get("3d_mode") == "pageflip"; + // Determine driver video::E_DRIVER_TYPE driverType = video::EDT_OPENGL; std::string driverstring = g_settings->get("video_driver"); @@ -549,9 +544,11 @@ bool ClientLauncher::create_engine_device(int log_level) params.AntiAlias = fsaa; params.Fullscreen = fullscreen; params.Stencilbuffer = false; + params.Stereobuffer = stereo_buffer; params.Vsync = vsync; params.EventReceiver = receiver; params.HighPrecisionFPU = g_settings->getBool("high_precision_fpu"); + params.ZBufferBits = 24; #ifdef __ANDROID__ params.PrivateData = porting::app_global; params.OGLES2ShaderPath = std::string(porting::path_user + DIR_DELIM + @@ -561,10 +558,6 @@ bool ClientLauncher::create_engine_device(int log_level) device = createDeviceEx(params); if (device) { - // Map our log level to irrlicht engine one. - ILogger* irr_logger = device->getLogger(); - irr_logger->setLogLevel(irr_log_level[log_level]); - porting::initIrrlicht(device); } @@ -651,14 +644,14 @@ void ClientLauncher::speed_tests() infostream << "Around 5000/ms should do well here." << std::endl; TimeTaker timer("Testing mutex speed"); - JMutex m; + Mutex m; u32 n = 0; u32 i = 0; do { n += 10000; for (; i < n; i++) { - m.Lock(); - m.Unlock(); + m.lock(); + m.unlock(); } } // Do at least 10ms @@ -696,7 +689,7 @@ bool ClientLauncher::print_video_modes() return false; } - dstream << _("Available video modes (WxHxD):") << std::endl; + std::cout << _("Available video modes (WxHxD):") << std::endl; video::IVideoModeList *videomode_list = nulldevice->getVideoModeList(); @@ -707,14 +700,14 @@ bool ClientLauncher::print_video_modes() for (s32 i = 0; i < videomode_count; ++i) { videomode_res = videomode_list->getVideoModeResolution(i); videomode_depth = videomode_list->getVideoModeDepth(i); - dstream << videomode_res.Width << "x" << videomode_res.Height + std::cout << videomode_res.Width << "x" << videomode_res.Height << "x" << videomode_depth << std::endl; } - dstream << _("Active video mode (WxHxD):") << std::endl; + std::cout << _("Active video mode (WxHxD):") << std::endl; videomode_res = videomode_list->getDesktopResolution(); videomode_depth = videomode_list->getDesktopDepth(); - dstream << videomode_res.Width << "x" << videomode_res.Height + std::cout << videomode_res.Width << "x" << videomode_res.Height << "x" << videomode_depth << std::endl; } |