aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/debugoverlay.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 00:40:53 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 00:40:53 +0100
commitf230156cbebc1b93db5e254410ee2ab3a8dcb27c (patch)
treee98c72fabbff37a55e7f9216c52e4f8ef2084073 /NorthstarDedicatedTest/debugoverlay.cpp
parent6c8112a6c368dd36d21fd94689e9682bc3b012a5 (diff)
downloadNorthstarLauncher-f230156cbebc1b93db5e254410ee2ab3a8dcb27c.tar.gz
NorthstarLauncher-f230156cbebc1b93db5e254410ee2ab3a8dcb27c.zip
use in-file macros rather than global funcs for registering dll load callbacks
Diffstat (limited to 'NorthstarDedicatedTest/debugoverlay.cpp')
-rw-r--r--NorthstarDedicatedTest/debugoverlay.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/debugoverlay.cpp b/NorthstarDedicatedTest/debugoverlay.cpp
index e29da96b..db0f09fa 100644
--- a/NorthstarDedicatedTest/debugoverlay.cpp
+++ b/NorthstarDedicatedTest/debugoverlay.cpp
@@ -1,4 +1,5 @@
#include "pch.h"
+#include "hooks.h"
#include "debugoverlay.h"
#include "dedicated.h"
#include "cvar.h"
@@ -151,11 +152,8 @@ void __fastcall DrawOverlayHook(OverlayBase_t* pOverlay)
LeaveCriticalSection((LPCRITICAL_SECTION)((char*)sEngineModule + 0x10DB0A38));
}
-void InitialiseDebugOverlay(HMODULE baseAddress)
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", DebugOverlay, ConVar, (HMODULE baseAddress)
{
- if (IsDedicated())
- return;
-
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0xABCB0, &DrawOverlayHook, reinterpret_cast<LPVOID*>(&DrawOverlay));
@@ -172,4 +170,4 @@ void InitialiseDebugOverlay(HMODULE baseAddress)
Cvar_enable_debug_overlays->SetValue(false);
Cvar_enable_debug_overlays->m_pszDefaultValue = (char*)"0";
Cvar_enable_debug_overlays->AddFlags(FCVAR_CHEAT);
-} \ No newline at end of file
+}) \ No newline at end of file