mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Sync Frame ID between main thread and render thread, this changes makes the integration PASS the reflex test utility.
37 lines
1017 B
C++
37 lines
1017 B
C++
#include "keys.h"
|
|
#include "windows/id3dx.h"
|
|
#include "geforce/reflex.h"
|
|
#include <materialsystem/cmaterialsystem.h>
|
|
|
|
KeyInfo_t* g_pKeyInfo = nullptr;
|
|
ButtonCode_t* g_pKeyEventTicks = nullptr;
|
|
short* g_nKeyEventCount = nullptr;
|
|
|
|
|
|
bool Input_Event(const InputEvent_t& inputEvent, const int noKeyUpCheck)
|
|
{
|
|
bool runTriggerMarker = inputEvent.m_nData == ButtonCode_t::MOUSE_LEFT;
|
|
const KeyInfo_t& keyInfo = g_pKeyInfo[inputEvent.m_nData];
|
|
|
|
if (noKeyUpCheck)
|
|
{
|
|
const int v = (inputEvent.m_nType & 0xFFFFFFFD) == 0;
|
|
|
|
if (keyInfo.m_nKeyDownTarget == v)
|
|
runTriggerMarker = false;
|
|
}
|
|
|
|
if (runTriggerMarker && (inputEvent.m_nType != IE_ButtonReleased || keyInfo.m_bTrapKeyUp))
|
|
{
|
|
GFX_SetLatencyMarker(D3D11Device(), TRIGGER_FLASH, MaterialSystem()->GetCurrentFrameCount());
|
|
}
|
|
|
|
return v_Input_Event(inputEvent, noKeyUpCheck);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void VKeys::Detour(const bool bAttach) const
|
|
{
|
|
DetourSetup(&v_Input_Event, &Input_Event, bAttach);
|
|
}
|