diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-07-07 21:31:41 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-07-07 21:31:41 +0100 |
commit | 2ae34b67e36b8ba05132d481876eb4ed7a826283 (patch) | |
tree | 63f44c8e2dcdc959d7a5317a3a7b36efedbd7d38 /NorthstarDLL/latencyflex.cpp | |
parent | 3406de7aaaf52cbef20b1549f2d7da0255d30f51 (diff) | |
download | NorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.tar.gz NorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.zip |
almost fully replaced hooking lib
Diffstat (limited to 'NorthstarDLL/latencyflex.cpp')
-rw-r--r-- | NorthstarDLL/latencyflex.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/NorthstarDLL/latencyflex.cpp b/NorthstarDLL/latencyflex.cpp index 8c302df8..4e30a71a 100644 --- a/NorthstarDLL/latencyflex.cpp +++ b/NorthstarDLL/latencyflex.cpp @@ -1,41 +1,41 @@ -#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 {}; - -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) -{ - // Connect to the LatencyFleX service - // LatencyFleX is an open source vendor agnostic replacement for Nvidia Reflex input latency reduction technology. - // https://ishitatsuyuki.github.io/post/latencyflex/ - m_lfxModule = LoadLibraryA("latencyflex_wine.dll"); - - if (m_lfxModule == nullptr) - { - spdlog::info("Unable to load LatencyFleX library, LatencyFleX disabled."); - 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."); +#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 {};
+
+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)
+{
+ // Connect to the LatencyFleX service
+ // LatencyFleX is an open source vendor agnostic replacement for Nvidia Reflex input latency reduction technology.
+ // https://ishitatsuyuki.github.io/post/latencyflex/
+ m_lfxModule = LoadLibraryA("latencyflex_wine.dll");
+
+ if (m_lfxModule == nullptr)
+ {
+ spdlog::info("Unable to load LatencyFleX library, LatencyFleX disabled.");
+ 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.");
})
\ No newline at end of file |