mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Set and unset relative mouse mode where necessary (#12636)
* Set and unset relative mouse mode where necessary Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
475f85fc91
commit
62ee02b8ba
@ -552,6 +552,10 @@ void ClientLauncher::main_menu(MainMenuData *menudata)
|
||||
#ifndef ANDROID
|
||||
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
|
||||
|
||||
/* show main menu */
|
||||
GUIEngine mymenu(&input->joystick, guiroot, m_rendering_engine, &g_menumgr, menudata, *kill);
|
||||
|
@ -2520,6 +2520,12 @@ void Game::checkZoomEnabled()
|
||||
|
||||
void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
|
||||
{
|
||||
#if 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()) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user