diff --git a/main/source/cl_dll/vgui_ScorePanel.cpp b/main/source/cl_dll/vgui_ScorePanel.cpp index 3ae7ee4f..8cb3b1f8 100644 --- a/main/source/cl_dll/vgui_ScorePanel.cpp +++ b/main/source/cl_dll/vgui_ScorePanel.cpp @@ -185,7 +185,9 @@ void ScorePanel::HitTestPanel::internalMousePressed(MouseCode code) if (SDL_GetRelativeMouseMode() == SDL_TRUE) { SDL_SetRelativeMouseMode(SDL_FALSE); - gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //Fix for windowed mode centering being incorrect. + gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); //#ifdef WIN32 //ShowCursor(FALSE); diff --git a/main/source/cl_dll/vgui_TeamFortressViewport.cpp b/main/source/cl_dll/vgui_TeamFortressViewport.cpp index 3dd1beec..afd4f627 100644 --- a/main/source/cl_dll/vgui_TeamFortressViewport.cpp +++ b/main/source/cl_dll/vgui_TeamFortressViewport.cpp @@ -1524,7 +1524,8 @@ void TeamFortressViewport::HideOptionsMenu() gHUD.GetManager().SetMouseVisibility(false); - gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); } } diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index 0da1d456..1594ebff 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -2881,7 +2881,8 @@ int AvHHud::MsgFunc_SetTopDown(const char* pszName, int iSize, void* pbuf) if (CVAR_GET_FLOAT("m_rawinput") != 0) { SDL_SetRelativeMouseMode(SDL_FALSE); - gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); #ifdef WIN32 //Hide windows OS cursor while raw input is momentarily off. diff --git a/main/source/mod/AvHParticleEditorHandler.cpp b/main/source/mod/AvHParticleEditorHandler.cpp index e9d28e23..663e18ce 100644 --- a/main/source/mod/AvHParticleEditorHandler.cpp +++ b/main/source/mod/AvHParticleEditorHandler.cpp @@ -90,7 +90,8 @@ void AvHParticleEditorHandler::ToggleEdit() gHUD.ToggleMouse(); // Set mouse position to center so it doesn't jar our view - gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); sInEditMode = false; } diff --git a/main/source/mod/AvHPieMenuHandler.cpp b/main/source/mod/AvHPieMenuHandler.cpp index 65e70f09..7c5f2780 100644 --- a/main/source/mod/AvHPieMenuHandler.cpp +++ b/main/source/mod/AvHPieMenuHandler.cpp @@ -203,7 +203,8 @@ void AvHPieMenuHandler::OpenPieMenu(void) if (CVAR_GET_FLOAT("m_rawinput") != 0 && !sPieMenuOpen) { SDL_SetRelativeMouseMode(SDL_FALSE); - gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + //gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY()); + gEngfuncs.pfnSetMousePos(ScreenWidth() / 2, ScreenHeight() / 2); } // Only do this when in full screen