aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/latencyflex.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-26 23:09:15 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-26 23:09:15 +0100
commit2171d95e1221442081bade7929c05b82ca0f2a08 (patch)
tree78e2d33c13fb0353e3869b08b15c3a6cc3c60393 /NorthstarDedicatedTest/latencyflex.cpp
parentcc7b0ded08e3dc26fc970169a79c74c54e4f923b (diff)
downloadNorthstarLauncher-2171d95e1221442081bade7929c05b82ca0f2a08.tar.gz
NorthstarLauncher-2171d95e1221442081bade7929c05b82ca0f2a08.zip
update more stuff to new hook macros
Diffstat (limited to 'NorthstarDedicatedTest/latencyflex.cpp')
-rw-r--r--NorthstarDedicatedTest/latencyflex.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/latencyflex.cpp b/NorthstarDedicatedTest/latencyflex.cpp
index 87057a00..8c302df8 100644
--- a/NorthstarDedicatedTest/latencyflex.cpp
+++ b/NorthstarDedicatedTest/latencyflex.cpp
@@ -1,21 +1,22 @@
#include "pch.h"
#include "convar.h"
+AUTOHOOK_INIT()
+
ConVar* Cvar_r_latencyflex;
HMODULE m_lfxModule {};
typedef void (*PFN_winelfx_WaitAndBeginFrame)();
PFN_winelfx_WaitAndBeginFrame m_winelfx_WaitAndBeginFrame {};
-typedef void (*OnRenderStartType)();
-OnRenderStartType OnRenderStart;
-void OnRenderStartHook()
+AUTOHOOK(OnRenderStart, client.dll + 0x1952C0,
+void,, (),
{
if (Cvar_r_latencyflex->GetInt())
m_winelfx_WaitAndBeginFrame();
OnRenderStart();
-}
+})
ON_DLL_LOAD_CLIENT_RELIESON("client.dll", LatencyFlex, ConVar, [](HMODULE baseAddress)
{
@@ -30,12 +31,11 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", LatencyFlex, ConVar, [](HMODULE baseAd
return;
}
+ AUTOHOOK_DISPATCH()
+
m_winelfx_WaitAndBeginFrame =
reinterpret_cast<PFN_winelfx_WaitAndBeginFrame>(reinterpret_cast<void*>(GetProcAddress(m_lfxModule, "winelfx_WaitAndBeginFrame")));
spdlog::info("LatencyFleX initialized.");
Cvar_r_latencyflex = new ConVar("r_latencyflex", "1", FCVAR_ARCHIVE, "Whether or not to use LatencyFleX input latency reduction.");
-
- HookEnabler hook;
- ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x1952C0, &OnRenderStartHook, reinterpret_cast<LPVOID*>(&OnRenderStart));
}) \ No newline at end of file