aboutsummaryrefslogtreecommitdiff
path: root/primedev/client
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2024-08-31 10:34:12 +0100
committerGitHub <noreply@github.com>2024-08-31 11:34:12 +0200
commit4d609a8d1cafae13b5ec14ad05f6e44e990cd403 (patch)
tree7a8d98a0d9439e8f86be895f36f48df26a0075a3 /primedev/client
parenta60c2738a2a0247ef46db8bae55f5dfd0c0f14c3 (diff)
downloadNorthstarLauncher-4d609a8d1cafae13b5ec14ad05f6e44e990cd403.tar.gz
NorthstarLauncher-4d609a8d1cafae13b5ec14ad05f6e44e990cd403.zip
client: Remove uses of Autohook from `latencyflex.cpp` (#789)
Removes AUTOHOOK macro from `latencyflex.cpp`.
Diffstat (limited to 'primedev/client')
-rw-r--r--primedev/client/latencyflex.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/primedev/client/latencyflex.cpp b/primedev/client/latencyflex.cpp
index 39557870..be93fabd 100644
--- a/primedev/client/latencyflex.cpp
+++ b/primedev/client/latencyflex.cpp
@@ -1,20 +1,16 @@
#include "core/convar/convar.h"
-AUTOHOOK_INIT()
-
ConVar* Cvar_r_latencyflex;
void (*m_winelfx_WaitAndBeginFrame)();
-// clang-format off
-AUTOHOOK(OnRenderStart, client.dll + 0x1952C0,
-void, __fastcall, ())
-// clang-format on
+void(__fastcall* o_pOnRenderStart)() = nullptr;
+void __fastcall h_OnRenderStart()
{
if (Cvar_r_latencyflex->GetBool() && m_winelfx_WaitAndBeginFrame)
m_winelfx_WaitAndBeginFrame();
- OnRenderStart();
+ o_pOnRenderStart();
}
ON_DLL_LOAD_CLIENT_RELIESON("client.dll", LatencyFlex, ConVar, (CModule module))
@@ -36,7 +32,8 @@ ON_DLL_LOAD_CLIENT_RELIESON("client.dll", LatencyFlex, ConVar, (CModule module))
return;
}
- AUTOHOOK_DISPATCH()
+ o_pOnRenderStart = module.Offset(0x1952C0).RCast<decltype(o_pOnRenderStart)>();
+ HookAttach(&(PVOID&)o_pOnRenderStart, (PVOID)h_OnRenderStart);
spdlog::info("LatencyFleX initialized.");
Cvar_r_latencyflex = new ConVar("r_latencyflex", "1", FCVAR_ARCHIVE, "Whether or not to use LatencyFleX input latency reduction.");