summaryrefslogtreecommitdiffstats
path: root/src/core/Frontend.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-16 22:43:35 +0100
committeraap <aap@papnet.eu>2020-11-16 22:43:35 +0100
commit46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44 (patch)
tree0ba07eade718824f6384d9baabf733f9752410ef /src/core/Frontend.cpp
parentanimation compression from PS2 (diff)
parentpragma twice (diff)
downloadre3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar.gz
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar.bz2
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar.lz
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar.xz
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.tar.zst
re3-46253fbf7d2a1b0cf9d2f0ab5f7e79035a997b44.zip
Diffstat (limited to 'src/core/Frontend.cpp')
-rw-r--r--src/core/Frontend.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 4be23b77..b84b691d 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -5433,6 +5433,10 @@ CMenuManager::SetHelperText(int text)
void
CMenuManager::ShutdownJustMenu()
{
+ // In case we're windowed, keep mouse centered while in game. Done in main.cpp in other conditions.
+#if defined(RW_GL3) && defined(IMPROVED_VIDEOMODE)
+ glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+#endif
m_bMenuActive = false;
CTimer::EndUserPause();
}
@@ -5529,8 +5533,14 @@ CMenuManager::SwitchMenuOnAndOff()
gMusicPlaying = 0;
}
*/
- if (m_bMenuActive != menuWasActive)
+ if (m_bMenuActive != menuWasActive) {
m_bMenuStateChanged = true;
+
+ // In case we're windowed, keep mouse centered while in game. Done in main.cpp in other conditions.
+#if defined(RW_GL3) && defined(IMPROVED_VIDEOMODE)
+ glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, m_bMenuActive && m_nPrefsWindowed ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_DISABLED);
+#endif
+ }
m_bStartUpFrontEndRequested = false;
m_bShutDownFrontEndRequested = false;