summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp9
-rw-r--r--src/core/main.cpp4
2 files changed, 10 insertions, 3 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 4be23b77..ffcd8b30 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -5529,8 +5529,15 @@ CMenuManager::SwitchMenuOnAndOff()
gMusicPlaying = 0;
}
*/
- if (m_bMenuActive != menuWasActive)
+ if (m_bMenuActive != menuWasActive) {
m_bMenuStateChanged = true;
+
+ // Keep mouse centered while in game. Done in main.cpp in other conditions.
+ // IMPROVED_VIDEOMODE because otherwise there is no way for windowed mode.
+#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;
diff --git a/src/core/main.cpp b/src/core/main.cpp
index cd234588..157776e0 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1090,9 +1090,9 @@ Idle(void *arg)
if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu) &&
TheCamera.GetScreenFadeStatus() != FADE_2)
{
-#ifdef GTA_PC
+ // This is from SA, but it's nice for windowed mode
+#if defined(GTA_PC) && !defined(RW_GL3)
if (!FrontEndMenuManager.m_bRenderGameInMenu) {
- // This is from SA, but it's nice for windowed mode
RwV2d pos;
pos.x = SCREEN_WIDTH / 2.0f;
pos.y = SCREEN_HEIGHT / 2.0f;