mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 13:53:49 -07:00
[579] Add simulated input lag option (#1438)
* [579] Add simulated input lag option * Continue to clear buffer when inputs are blocked * Changes from feedback
This commit is contained in:
parent
55e79cd9d2
commit
f712068a17
6 changed files with 49 additions and 29 deletions
|
@ -504,6 +504,11 @@ namespace GameMenuBar {
|
|||
UIWidgets::EnhancementSliderFloat("Input Scale: %.1f", "##Input", "gInputScale", 1.0f, 3.0f, "", 1.0f, false);
|
||||
UIWidgets::Tooltip("Sets the on screen size of the displayed inputs from the Show Inputs setting");
|
||||
ImGui::PopItemWidth();
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 20.0f);
|
||||
UIWidgets::EnhancementSliderInt("Simulated Input Lag: %d frames", "##SimulatedInputLag", "gSimulatedInputLag", 0, 6, "", 0, false);
|
||||
UIWidgets::Tooltip("Buffers your inputs to be executed a specified amount of frames later");
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
|
|
@ -483,10 +483,7 @@ static void RunFrame()
|
|||
|
||||
Graph_StartFrame();
|
||||
|
||||
// TODO: Workaround for rumble being too long. Implement os thread functions.
|
||||
for (int i = 0; i < 3; i++) {
|
||||
PadMgr_ThreadEntry(&gPadMgr);
|
||||
}
|
||||
PadMgr_ThreadEntry(&gPadMgr);
|
||||
|
||||
Graph_Update(&runFrameContext.gfxCtx, runFrameContext.gameState);
|
||||
ticksB = GetPerfCounter();
|
||||
|
|
|
@ -331,16 +331,20 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) {
|
|||
}
|
||||
padMgr->validCtrlrsMask = mask;
|
||||
|
||||
/* if (gFaultStruct.msgId) {
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else */ if (padMgr->rumbleOffFrames > 0) {
|
||||
--padMgr->rumbleOffFrames;
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else if (padMgr->rumbleOnFrames == 0) {
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else if (!padMgr->preNMIShutdown) {
|
||||
PadMgr_RumbleControl(padMgr);
|
||||
--padMgr->rumbleOnFrames;
|
||||
// TODO: Workaround for rumble being too long. Implement os thread functions.
|
||||
// Game logic runs at 20hz but input thread runs at 60 hertz, so we call this 3 times
|
||||
for (i = 0; i < 3; i++) {
|
||||
/* if (gFaultStruct.msgId) {
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else */ if (padMgr->rumbleOffFrames > 0) {
|
||||
--padMgr->rumbleOffFrames;
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else if (padMgr->rumbleOnFrames == 0) {
|
||||
PadMgr_RumbleStop(padMgr);
|
||||
} else if (!padMgr->preNMIShutdown) {
|
||||
PadMgr_RumbleControl(padMgr);
|
||||
--padMgr->rumbleOnFrames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue