From 263af88bb67349b5193dea6dac33664fc70bfede Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Feb 2023 13:39:33 +0000 Subject: fix formatting --- NorthstarDLL/core/hooks.cpp | 2 +- NorthstarDLL/core/hooks.h | 17 ++++++++++++----- NorthstarDLL/shared/playlist.cpp | 8 ++++---- 3 files changed, 17 insertions(+), 10 deletions(-) (limited to 'NorthstarDLL') diff --git a/NorthstarDLL/core/hooks.cpp b/NorthstarDLL/core/hooks.cpp index 91cb9a90..d3b9cfc5 100644 --- a/NorthstarDLL/core/hooks.cpp +++ b/NorthstarDLL/core/hooks.cpp @@ -68,7 +68,7 @@ void __fileAutohook::Dispatch() { for (__autovar* var : vars) var->Dispatch(); - + for (__autohook* hook : hooks) hook->Dispatch(); } diff --git a/NorthstarDLL/core/hooks.h b/NorthstarDLL/core/hooks.h index 2f7e21b4..0eb3f7fb 100644 --- a/NorthstarDLL/core/hooks.h +++ b/NorthstarDLL/core/hooks.h @@ -307,10 +307,17 @@ class __autovar }; // VAR_AT(engine.dll+0x404, ConVar*, Cvar_host_timescale) -#define VAR_AT(addrString, type, name) \ -type name; namespace { __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); } +#define VAR_AT(addrString, type, name) \ + type name; \ + namespace \ + { \ + __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); \ + } // FUNCTION_AT(engine.dll + 0xDEADBEEF, void, __fastcall, SomeFunc, (void* a1)) -#define FUNCTION_AT(addrString, type, callingConvention, name, args) \ -type(*callingConvention name) args; namespace { __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); } - +#define FUNCTION_AT(addrString, type, callingConvention, name, args) \ + type(*callingConvention name) args; \ + namespace \ + { \ + __autovar CONCAT2(__autovar, __LINE__)(&__FILEAUTOHOOK, __STR(addrString), (void**)&name); \ + } diff --git a/NorthstarDLL/shared/playlist.cpp b/NorthstarDLL/shared/playlist.cpp index 4d4c8906..0f20a957 100644 --- a/NorthstarDLL/shared/playlist.cpp +++ b/NorthstarDLL/shared/playlist.cpp @@ -11,10 +11,10 @@ AUTOHOOK_INIT() // use the R2 namespace for game funcs namespace R2 { - FUNCTION_AT(engine.dll + 0x18C640, const char*,, GetCurrentPlaylistName, ()); - FUNCTION_AT(engine.dll + 0x18EB20, void,, SetCurrentPlaylist, (const char* pPlaylistName)); - FUNCTION_AT(engine.dll + 0x18ED00, void,, SetPlaylistVarOverride, (const char* pVarName, const char* pValue)); - FUNCTION_AT(engine.dll + 0x18C680, const char*,, GetCurrentPlaylistVar, (const char* pVarName, bool bUseOverrides)); + FUNCTION_AT(engine.dll + 0x18C640, const char*, , GetCurrentPlaylistName, ()); + FUNCTION_AT(engine.dll + 0x18EB20, void, , SetCurrentPlaylist, (const char* pPlaylistName)); + FUNCTION_AT(engine.dll + 0x18ED00, void, , SetPlaylistVarOverride, (const char* pVarName, const char* pValue)); + FUNCTION_AT(engine.dll + 0x18C680, const char*, , GetCurrentPlaylistVar, (const char* pVarName, bool bUseOverrides)); } // namespace R2 ConVar* Cvar_ns_use_clc_SetPlaylistVarOverride; -- cgit v1.2.3