mirror of
https://github.com/ddeverill/SteamlessController.git
synced 2026-10-23 07:02:16 -05:00
Address review feedback on rumble forwarding PR
- Drop Tick()/m_wantsGameMode auto-enable machinery (out of scope for this PR — belongs in a separate submission) - Remove unused CMD_TRIGGER_RUMBLE constant - Fix WriteOutputReport comment to accurately describe padding behaviour - Fix CancelIo OVERLAPPED use-after-free: drain with GetOverlappedResult before the stack OVERLAPPED goes out of scope - Strip redundant /wd4819 /wd4828 MSVC flags; /utf-8 already covers them - Add comment to HeartbeatLoop explaining the 40 ms tick rationale Co-Authored-By: Dylan Deverill <ddeverill@gmail.com>
This commit is contained in:
1 parent
e5416d53a5
commit
f7c4f13c90
9 files changed
+19
-39
No files matched your search
@@ -20,24 +20,9 @@ void ControllerManager::OnDeviceChange() {
|
||||
TryOpen();
|
||||
else if (g_ctrl && !g_ctrl->IsOpen())
|
||||
Close(/*restoreLizard=*/false);
|
||||
|
||||
if (m_connected && m_wantsGameMode && !m_gameModeActive)
|
||||
EnableGameMode();
|
||||
}
|
||||
|
||||
void ControllerManager::Tick() {
|
||||
if (!m_connected) {
|
||||
TryOpen();
|
||||
} else if (g_ctrl && !g_ctrl->IsOpen()) {
|
||||
Close(/*restoreLizard=*/false);
|
||||
}
|
||||
|
||||
if (m_connected && m_wantsGameMode && !m_gameModeActive)
|
||||
EnableGameMode();
|
||||
}
|
||||
|
||||
void ControllerManager::EnableGameMode() {
|
||||
m_wantsGameMode = true;
|
||||
if (!m_connected || m_gameModeActive) return;
|
||||
if (!g_ctrl->DisableLizardMode()) return;
|
||||
|
||||
@@ -67,7 +52,6 @@ void ControllerManager::EnableGameMode() {
|
||||
}
|
||||
|
||||
void ControllerManager::DisableGameMode() {
|
||||
m_wantsGameMode = false;
|
||||
if (!m_gameModeActive) return;
|
||||
StopReadLoop();
|
||||
if (g_ctrl && g_ctrl->IsOpen())
|
||||
@@ -99,8 +83,6 @@ void ControllerManager::TryOpen() {
|
||||
if (g_ctrl->Open()) {
|
||||
m_connected = true;
|
||||
m_onStateChanged(m_connected, m_gameModeActive, false);
|
||||
if (m_wantsGameMode && !m_gameModeActive)
|
||||
EnableGameMode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user