]> git.lizzy.rs Git - minetest.git/blobdiff - src/client/clientlauncher.cpp
Fix crash on Android with IrrlichtMt9 (#13123)
[minetest.git] / src / client / clientlauncher.cpp
index 06315431681b3fa10be3f849bb9567c4365587eb..843c7ad3201994453cef39b14801ddffbd5f15a8 100644 (file)
@@ -417,7 +417,7 @@ bool ClientLauncher::launch_game(std::string &error_message,
                menudata.name                            = start_data.name;
                menudata.password                        = start_data.password;
                menudata.port                            = itos(start_data.socket_port);
-               menudata.script_data.errormessage        = error_message_lua;
+               menudata.script_data.errormessage        = std::move(error_message_lua);
                menudata.script_data.reconnect_requested = reconnect_requested;
 
                main_menu(&menudata);
@@ -451,6 +451,7 @@ bool ClientLauncher::launch_game(std::string &error_message,
                start_data.name = menudata.name;
                start_data.password = menudata.password;
                start_data.address = std::move(menudata.address);
+               start_data.allow_login_or_register = menudata.allow_login_or_register;
                server_name = menudata.servername;
                server_description = menudata.serverdescription;
 
@@ -547,11 +548,18 @@ void ClientLauncher::main_menu(MainMenuData *menudata)
        }
        infostream << "Waited for other menus" << std::endl;
 
-       // Cursor can be non-visible when coming from the game
 #ifndef ANDROID
+       // Cursor can be non-visible when coming from the game
        m_rendering_engine->get_raw_device()->getCursorControl()->setVisible(true);
+
+       // Set absolute mouse mode
+#if IRRLICHT_VERSION_MT_REVISION >= 9
+       m_rendering_engine->get_raw_device()->getCursorControl()->setRelativeMode(false);
 #endif
 
+#endif
+
+
        /* show main menu */
        GUIEngine mymenu(&input->joystick, guiroot, m_rendering_engine, &g_menumgr, menudata, *kill);
 
@@ -564,6 +572,8 @@ void ClientLauncher::speed_tests()
        // volatile to avoid some potential compiler optimisations
        volatile static s16 temp16;
        volatile static f32 tempf;
+       // Silence compiler warning
+       (void)temp16;
        static v3f tempv3f1;
        static v3f tempv3f2;
        static std::string tempstring;
@@ -579,8 +589,8 @@ void ClientLauncher::speed_tests()
                TimeTaker timer("Testing std::string speed");
                const u32 jj = 10000;
                for (u32 j = 0; j < jj; j++) {
-                       tempstring = "";
-                       tempstring2 = "";
+                       tempstring.clear();
+                       tempstring2.clear();
                        const u32 ii = 10;
                        for (u32 i = 0; i < ii; i++) {
                                tempstring2 += "asd";