]> git.lizzy.rs Git - minetest.git/commitdiff
Fix crash on Android with IrrlichtMt9 (#13123)
authorROllerozxa <rollerozxa@voxelmanip.se>
Sun, 8 Jan 2023 13:04:17 +0000 (14:04 +0100)
committerGitHub <noreply@github.com>
Sun, 8 Jan 2023 13:04:17 +0000 (14:04 +0100)
Caused by mouse control

src/client/clientlauncher.cpp
src/client/game.cpp

index 94d2a38c9d1eea97025b2fb6194c0e7f7a3601e5..843c7ad3201994453cef39b14801ddffbd5f15a8 100644 (file)
@@ -548,15 +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);
-#endif
+
        // 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);
 
index 56d4ae13e19408772ea14d1cc29a25dc983f74c6..76612879c00b458d548d2b117a1db355251e5b13 100644 (file)
@@ -2535,12 +2535,13 @@ void Game::checkZoomEnabled()
 
 void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
 {
-#if IRRLICHT_VERSION_MT_REVISION >= 9
+#if !defined(__ANDROID__) && IRRLICHT_VERSION_MT_REVISION >= 9
        if (isMenuActive())
                device->getCursorControl()->setRelativeMode(false);
        else
                device->getCursorControl()->setRelativeMode(true);
 #endif
+
        if ((device->isWindowActive() && device->isWindowFocused()
                        && !isMenuActive()) || input->isRandom()) {