File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1149,6 +1149,11 @@ class InputDevice {
11491149 virtual void PollDevice () {
11501150 if (!bGlobalDoPolling) return ;
11511151
1152+ if (bBlockThisPoll) {
1153+ bBlockThisPoll = false ;
1154+ return ;
1155+ }
1156+
11521157 ReadControllerData ();
11531158 WORD wButtons = g_Controllers[fDeviceIndex ].state .Gamepad .wButtons ;
11541159 WORD SecondBind = 0 ;
@@ -1992,13 +1997,24 @@ int Init() {
19921997 return 0 ;
19931998}
19941999
2000+ //
2001+ // Interface functions -- for use with other plugins and/or mods.
2002+ //
2003+
19952004extern " C" __declspec(dllexport) bool GetPollingState () { return bGlobalDoPolling; }
19962005
19972006extern " C" __declspec(dllexport) bool SetPollingState (bool state) {
19982007 bGlobalDoPolling = state;
19992008 return state;
20002009}
20012010
2011+ // Blocks a poll for exactly 1 poll cycle -- useful for frame-accurate blocks
2012+ extern " C" __declspec(dllexport) void BlockNextPoll () {
2013+ bBlockThisPoll = true ;
2014+ }
2015+
2016+ extern " C" __declspec(dllexport) bool GetBlockNextPoll () { return bBlockThisPoll; }
2017+
20022018#ifndef NO_FENG
20032019extern " C" __declspec(dllexport) float GetFEScale () { return fFEScale ; }
20042020
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ unsigned int ControllerIconMode = 0; // read modes above
5454
5555bool bInDebugWorldCamera = false ;
5656bool bGlobalDoPolling = true ;
57+ bool bBlockThisPoll = false ;
5758bool bEnableSplashTakeover = true ;
5859#ifndef NO_FENG
5960bool bConsoleFEng = false ;
You can’t perform that action at this time.
0 commit comments