diff options
author | erorcun <erayorcunus@gmail.com> | 2020-07-24 20:07:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-24 20:07:23 +0200 |
commit | b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda (patch) | |
tree | 929528298d437e2868071683228743f47accc173 /src/core | |
parent | Merge pull request #661 from erorcun/miami (diff) | |
parent | 90% fixes, 10% skel refactoring (diff) | |
download | re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar.gz re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar.bz2 re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar.lz re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar.xz re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.tar.zst re3-b05cb3f1a3a1a5fbc18efe78a58e1408a1f2ffda.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Frontend.cpp | 7 | ||||
-rw-r--r-- | src/core/Pad.cpp | 19 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index e5776459..06744ac2 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -5155,13 +5155,10 @@ CMenuManager::SwitchMenuOnAndOff() m_bMenuActive = !m_bMenuActive; if (m_bMenuActive) { -#if defined RW_D3D9 || defined RWLIBS if (_InputMouseNeedsExclusive()) { _InputShutdownMouse(); _InputInitialiseMouse(false); } -#endif - Initialise(); LoadAllTextures(); } else { @@ -5173,12 +5170,10 @@ CMenuManager::SwitchMenuOnAndOff() DoRWStuffEndOfFrame(); DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255); DoRWStuffEndOfFrame(); -#if defined RW_D3D9 || defined RWLIBS if (_InputMouseNeedsExclusive()) { _InputShutdownMouse(); _InputInitialiseMouse(true); } -#endif #ifdef PS2_LIKE_MENU bottomBarActive = false; @@ -5223,12 +5218,10 @@ CMenuManager::SwitchMenuOnAndOff() m_bMenuActive = true; m_OnlySaveMenu = true; -#if defined RW_D3D9 || defined RWLIBS if (_InputMouseNeedsExclusive()) { _InputShutdownMouse(); _InputInitialiseMouse(false); } -#endif Initialise(); LoadAllTextures(); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 685256e3..8043bb6c 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -722,9 +722,9 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp() void CPad::UpdateMouse() { +#if defined RW_D3D9 || defined RWLIBS if ( IsForegroundApp() ) { -#if defined RW_D3D9 || defined RWLIBS if ( PSGLOBAL(mouse) == nil ) _InputInitialiseMouse(!FrontEndMenuManager.m_bMenuActive && _InputMouseNeedsExclusive()); @@ -761,7 +761,10 @@ void CPad::UpdateMouse() OldMouseControllerState = NewMouseControllerState; NewMouseControllerState = PCTempMouseControllerState; } + } #else + if ( IsForegroundApp() && PSGLOBAL(cursorIsInWindow) ) + { double xpos = 1.0f, ypos; glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos); if (xpos == 0.f) @@ -799,8 +802,8 @@ void CPad::UpdateMouse() OldMouseControllerState = NewMouseControllerState; NewMouseControllerState = PCTempMouseControllerState; -#endif } +#endif } CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &State1, CControllerState const &State2) @@ -1451,6 +1454,13 @@ void CPad::UpdatePads(void) #else CapturePad(0); #endif + + // Improve keyboard input latency part 1 +#ifdef FIX_BUGS + OldKeyState = NewKeyState; + NewKeyState = TempKeyState; +#endif + #ifdef DETECT_PAD_INPUT_SWITCH if (GetPad(0)->PCTempJoyState.CheckForInput()) IsAffectedByController = true; @@ -1472,7 +1482,7 @@ void CPad::UpdatePads(void) if ( bUpdate ) { GetPad(0)->Update(0); - GetPad(1)->Update(0); + // GetPad(1)->Update(0); // not in VC } #if defined(MASTER) && !defined(XINPUT) @@ -1480,8 +1490,11 @@ void CPad::UpdatePads(void) GetPad(1)->OldState.Clear(); #endif + // Improve keyboard input latency part 2 +#ifndef FIX_BUGS OldKeyState = NewKeyState; NewKeyState = TempKeyState; +#endif } void CPad::ProcessPCSpecificStuff(void) |