mirror of
https://github.com/ENSL/NS.git
synced 2024-11-24 21:41:17 +00:00
fix mouse centering for windowed mode
This commit is contained in:
parent
e241e23752
commit
f9a8db4963
5 changed files with 11 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue