Skip to content

Commit 2f02a69

Browse files
committed
project: remove all clang-format comments
1 parent 8a4948e commit 2f02a69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2
-194
lines changed

primedev/client/audio.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,8 @@ bool ShouldPlayAudioEvent(const char* eventName, const std::shared_ptr<EventOver
389389
return true; // good to go
390390
}
391391

392-
// clang-format off
393392
AUTOHOOK(LoadSampleMetadata, mileswin64.dll + 0xF110,
394393
bool, __fastcall, (void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType))
395-
// clang-format on
396394
{
397395
// Raw source, used for voice data only
398396
if (audioType == 0)
@@ -497,19 +495,15 @@ bool, __fastcall, (void* sample, void* audioBuffer, unsigned int audioBufferLeng
497495
return res;
498496
}
499497

500-
// clang-format off
501498
AUTOHOOK(sub_1800294C0, mileswin64.dll + 0x294C0,
502499
void*, __fastcall, (void* a1, void* a2))
503-
// clang-format on
504500
{
505501
pszAudioEventName = reinterpret_cast<const char*>((*((__int64*)a2 + 6)));
506502
return sub_1800294C0(a1, a2);
507503
}
508504

509-
// clang-format off
510505
AUTOHOOK(MilesLog, client.dll + 0x57DAD0,
511506
void, __fastcall, (int level, const char* string))
512-
// clang-format on
513507
{
514508
if (!Cvar_mileslog_enable->GetBool())
515509
return;

primedev/client/clientauthhooks.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ const int NOT_DECIDED_TO_SEND_TOKEN = 0;
1212
const int AGREED_TO_SEND_TOKEN = 1;
1313
const int DISAGREED_TO_SEND_TOKEN = 2;
1414

15-
// clang-format off
1615
AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
1716
void, __fastcall, (void* a1))
18-
// clang-format on
1917
{
2018
// don't attempt to do Atlas auth if we are in vanilla compatibility mode
2119
// this prevents users from joining untrustworthy servers (unless they use a concommand or something)
@@ -43,10 +41,8 @@ void, __fastcall, (void* a1))
4341

4442
char* p3PToken;
4543

46-
// clang-format off
4744
AUTOHOOK(Auth3PToken, engine.dll + 0x183760,
4845
char*, __fastcall, ())
49-
// clang-format on
5046
{
5147
if (!g_pVanillaCompatibility->GetVanillaCompatibility() && g_pMasterServerManager->m_sOwnClientAuthToken[0])
5248
{

primedev/client/clientruihooks.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ AUTOHOOK_INIT()
44

55
ConVar* Cvar_rui_drawEnable;
66

7-
// clang-format off
87
AUTOHOOK(DrawRUIFunc, engine.dll + 0xFC500,
98
bool, __fastcall, (void* a1, float* a2))
10-
// clang-format on
119
{
1210
if (!Cvar_rui_drawEnable->GetBool())
1311
return 0;

primedev/client/clientvideooverrides.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
AUTOHOOK_INIT()
44

5-
// clang-format off
65
AUTOHOOK_PROCADDRESS(BinkOpen, bink2w64.dll, BinkOpen,
76
void*, __fastcall, (const char* path, uint32_t flags))
8-
// clang-format on
97
{
108
std::string filename(fs::path(path).filename().string());
119
spdlog::info("BinkOpen {}", filename);

primedev/client/debugoverlay.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,8 @@ OverlayBase_t** s_pOverlays;
122122
int* g_nRenderTickCount;
123123
int* g_nOverlayTickCount;
124124

125-
// clang-format off
126125
AUTOHOOK(DrawOverlay, engine.dll + 0xABCB0,
127126
void, __fastcall, (OverlayBase_t * pOverlay))
128-
// clang-format on
129127
{
130128
EnterCriticalSection(s_OverlayMutex);
131129

@@ -205,10 +203,8 @@ void, __fastcall, (OverlayBase_t * pOverlay))
205203
LeaveCriticalSection(s_OverlayMutex);
206204
}
207205

208-
// clang-format off
209206
AUTOHOOK(DrawAllOverlays, engine.dll + 0xAB780,
210207
void, __fastcall, (bool bRender))
211-
// clang-format on
212208
{
213209
EnterCriticalSection(s_OverlayMutex);
214210

primedev/client/languagehooks.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ std::string GetAnyInstalledAudioLanguage()
4848
return "NO LANGUAGE DETECTED";
4949
}
5050

51-
// clang-format off
5251
AUTOHOOK(GetGameLanguage, tier0.dll + 0xF560,
5352
char*, __fastcall, ())
54-
// clang-format on
5553
{
5654
auto tier0Handle = GetModuleHandleA("tier0.dll");
5755
auto Tier0_DetectDefaultLanguageType = GetProcAddress(tier0Handle, "Tier0_DetectDefaultLanguage");

primedev/client/latencyflex.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ ConVar* Cvar_r_latencyflex;
66

77
void (*m_winelfx_WaitAndBeginFrame)();
88

9-
// clang-format off
109
AUTOHOOK(OnRenderStart, client.dll + 0x1952C0,
1110
void, __fastcall, ())
12-
// clang-format on
1311
{
1412
if (Cvar_r_latencyflex->GetBool() && m_winelfx_WaitAndBeginFrame)
1513
m_winelfx_WaitAndBeginFrame();

primedev/client/modlocalisation.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ AUTOHOOK_INIT()
44

55
void* g_pVguiLocalize;
66

7-
// clang-format off
87
AUTOHOOK(CLocalize__AddFile, localize.dll + 0x6D80,
98
bool, __fastcall, (void* pVguiLocalize, const char* path, const char* pathId, bool bIncludeFallbackSearchPaths))
10-
// clang-format on
119
{
1210
// save this for later
1311
g_pVguiLocalize = pVguiLocalize;
@@ -19,10 +17,8 @@ bool, __fastcall, (void* pVguiLocalize, const char* path, const char* pathId, bo
1917
return true;
2018
}
2119

22-
// clang-format off
2320
AUTOHOOK(CLocalize__ReloadLocalizationFiles, localize.dll + 0xB830,
2421
void, __fastcall, (void* pVguiLocalize))
25-
// clang-format on
2622
{
2723
// load all mod localization manually, so we keep track of all files, not just previously loaded ones
2824
for (Mod mod : g_pModManager->m_LoadedMods)
@@ -34,10 +30,8 @@ void, __fastcall, (void* pVguiLocalize))
3430
CLocalize__ReloadLocalizationFiles(pVguiLocalize);
3531
}
3632

37-
// clang-format off
3833
AUTOHOOK(CEngineVGui__Init, engine.dll + 0x247E10,
3934
void, __fastcall, (void* self))
40-
// clang-format on
4135
{
4236
CEngineVGui__Init(self); // this loads r1_english, valve_english, dev_english
4337

primedev/client/rejectconnectionfixes.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
AUTOHOOK_INIT()
44

55
// this is called from when our connection is rejected, this is the only case we're hooking this for
6-
// clang-format off
76
AUTOHOOK(COM_ExplainDisconnection, engine.dll + 0x1342F0,
87
void,, (bool a1, const char* fmt, ...))
9-
// clang-format on
108
{
119
va_list va;
1210
va_start(va, fmt);

primedev/core/filesystem/filesystem.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ std::string ReadVPKOriginalFile(const char* path)
4444
return ret;
4545
}
4646

47-
// clang-format off
4847
HOOK(AddSearchPathHook, AddSearchPath,
4948
void, __fastcall, (IFileSystem * fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType))
50-
// clang-format on
5149
{
5250
AddSearchPath(fileSystem, pPath, pathID, addType);
5351

@@ -97,10 +95,8 @@ bool TryReplaceFile(const char* pPath, bool shouldCompile)
9795
}
9896

9997
// force modded files to be read from mods, not cache
100-
// clang-format off
10198
HOOK(ReadFromCacheHook, ReadFromCache,
10299
bool, __fastcall, (IFileSystem * filesystem, char* pPath, void* result))
103-
// clang-format off
104100
{
105101
if (TryReplaceFile(pPath, true))
106102
return false;
@@ -109,10 +105,8 @@ bool, __fastcall, (IFileSystem * filesystem, char* pPath, void* result))
109105
}
110106

111107
// force modded files to be read from mods, not vpk
112-
// clang-format off
113108
AUTOHOOK(ReadFileFromVPK, filesystem_stdio.dll + 0x5CBA0,
114109
FileHandle_t, __fastcall, (VPKData* vpkInfo, uint64_t* b, char* filename))
115-
// clang-format on
116110
{
117111
// don't compile here because this is only ever called from OpenEx, which already compiles
118112
if (TryReplaceFile(filename, false))
@@ -124,10 +118,8 @@ FileHandle_t, __fastcall, (VPKData* vpkInfo, uint64_t* b, char* filename))
124118
return ReadFileFromVPK(vpkInfo, b, filename);
125119
}
126120

127-
// clang-format off
128121
AUTOHOOK(CBaseFileSystem__OpenEx, filesystem_stdio.dll + 0x15F50,
129122
FileHandle_t, __fastcall, (IFileSystem* filesystem, const char* pPath, const char* pOptions, uint32_t flags, const char* pPathID, char **ppszResolvedFilename))
130-
// clang-format on
131123
{
132124
TryReplaceFile(pPath, true);
133125
return CBaseFileSystem__OpenEx(filesystem, pPath, pOptions, flags, pPathID, ppszResolvedFilename);

primedev/core/filesystem/rpakfilesystem.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,8 @@ void LoadCustomMapPaks(char** pakName, bool* bNeedToFreePakName)
174174
}
175175
}
176176

177-
// clang-format off
178177
HOOK(LoadPakAsyncHook, LoadPakAsync,
179178
int, __fastcall, (char* pPath, void* unknownSingleton, int flags, void* pCallback0, void* pCallback1))
180-
// clang-format on
181179
{
182180
HandlePakAliases(&pPath);
183181

@@ -233,10 +231,8 @@ int, __fastcall, (char* pPath, void* unknownSingleton, int flags, void* pCallbac
233231
return iPakHandle;
234232
}
235233

236-
// clang-format off
237234
HOOK(UnloadPakHook, UnloadPak,
238235
void*, __fastcall, (int nPakHandle, void* pCallback))
239-
// clang-format on
240236
{
241237
// stop tracking the pak
242238
g_pPakLoadManager->RemoveLoadedPak(nPakHandle);
@@ -255,10 +251,8 @@ void*, __fastcall, (int nPakHandle, void* pCallback))
255251

256252
// we hook this exclusively for resolving stbsp paths, but seemingly it's also used for other stuff like vpk, rpak, mprj and starpak loads
257253
// tbh this actually might be for memory mapped files or something, would make sense i think
258-
// clang-format off
259254
HOOK(ReadFileAsyncHook, ReadFileAsync,
260255
void*, __fastcall, (const char* pPath, void* pCallback))
261-
// clang-format on
262256
{
263257
fs::path path(pPath);
264258
std::string newPath = "";

primedev/core/math/color.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
// clang-format off
32
namespace NS::Colors
43
{
54
Color SCRIPT_UI (100, 255, 255);
@@ -24,4 +23,3 @@ namespace NS::Colors
2423
Color CRIT (255, 0 , 0 );
2524
Color OFF (0 , 0 , 0 );
2625
};
27-
// clang-format on

primedev/core/sourceinterface.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ AUTOHOOK_INIT()
55

66
// really wanted to do a modular callback system here but honestly couldn't be bothered so hardcoding stuff for now: todo later
77

8-
// clang-format off
98
AUTOHOOK_PROCADDRESS(ClientCreateInterface, client.dll, CreateInterface,
109
void*, __fastcall, (const char* pName, const int* pReturnCode))
11-
// clang-format on
1210
{
1311
void* ret = ClientCreateInterface(pName, pReturnCode);
1412
spdlog::info("CreateInterface CLIENT {}", pName);
@@ -19,30 +17,24 @@ void*, __fastcall, (const char* pName, const int* pReturnCode))
1917
return ret;
2018
}
2119

22-
// clang-format off
2320
AUTOHOOK_PROCADDRESS(ServerCreateInterface, server.dll, CreateInterface,
2421
void*, __fastcall, (const char* pName, const int* pReturnCode))
25-
// clang-format on
2622
{
2723
void* ret = ServerCreateInterface(pName, pReturnCode);
2824
spdlog::info("CreateInterface SERVER {}", pName);
2925

3026
return ret;
3127
}
3228

33-
// clang-format off
3429
AUTOHOOK_PROCADDRESS(EngineCreateInterface, engine.dll, CreateInterface,
3530
void*, __fastcall, (const char* pName, const int* pReturnCode))
36-
// clang-format on
3731
{
3832
void* ret = EngineCreateInterface(pName, pReturnCode);
3933
spdlog::info("CreateInterface ENGINE {}", pName);
4034

4135
return ret;
4236
}
4337

44-
// clang-format off
4538
ON_DLL_LOAD("client.dll", ClientInterface, (CModule module)) {AUTOHOOK_DISPATCH_MODULE(client.dll)}
4639
ON_DLL_LOAD("server.dll", ServerInterface, (CModule module)) {AUTOHOOK_DISPATCH_MODULE(server.dll)}
4740
ON_DLL_LOAD("engine.dll", EngineInterface, (CModule module)) {AUTOHOOK_DISPATCH_MODULE(engine.dll)}
48-
// clang-format on

primedev/dedicated/dedicated.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ DWORD WINAPI ConsoleInputThread(PVOID pThreadParameter)
114114
return 0;
115115
}
116116

117-
// clang-format off
118117
AUTOHOOK(IsGameActiveWindow, engine.dll + 0x1CDC80,
119118
bool,, ())
120-
// clang-format on
121119
{
122120
return true;
123121
}
@@ -270,10 +268,8 @@ ON_DLL_LOAD_DEDI("tier0.dll", DedicatedServerOrigin, (CModule module))
270268
module.GetExportedFunction("Tier0_InitOrigin").Patch("C3");
271269
}
272270

273-
// clang-format off
274271
AUTOHOOK(PrintSquirrelError, server.dll + 0x794D0,
275272
void, __fastcall, (void* sqvm))
276-
// clang-format on
277273
{
278274
PrintSquirrelError(sqvm);
279275

primedev/dedicated/dedicatedmaterialsystem.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
AUTOHOOK_INIT()
55

6-
// clang-format off
76
AUTOHOOK(D3D11CreateDevice, materialsystem_dx11.dll + 0xD9A0E,
87
HRESULT, __stdcall, (
98
void* pAdapter,
@@ -16,7 +15,6 @@ HRESULT, __stdcall, (
1615
void** ppDevice,
1716
int* pFeatureLevel,
1817
void** ppImmediateContext))
19-
// clang-format on
2018
{
2119
// note: this is super duper temp pretty much just messing around with it
2220
// does run surprisingly well on dedi for a software driver tho if you ignore the +1gb ram usage at times, seems like dedi doesn't

primedev/engine/host.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
AUTOHOOK_INIT()
1010

11-
// clang-format off
1211
AUTOHOOK(Host_Init, engine.dll + 0x155EA0,
1312
void, __fastcall, (bool bDedicated))
14-
// clang-format on
1513
{
1614
spdlog::info("Host_Init()");
1715
Host_Init(bDedicated);

primedev/engine/hoststate.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ void ServerStartingOrChangingMap()
5353
g_pServerAuthentication->m_bStartingLocalSPGame = false;
5454
}
5555

56-
// clang-format off
5756
AUTOHOOK(CHostState__State_NewGame, engine.dll + 0x16E7D0,
5857
void, __fastcall, (CHostState* self))
59-
// clang-format on
6058
{
6159
spdlog::info("HostState: NewGame");
6260

@@ -82,10 +80,8 @@ void, __fastcall, (CHostState* self))
8280
g_pServerAuthentication->m_bNeedLocalAuthForNewgame = false;
8381
}
8482

85-
// clang-format off
8683
AUTOHOOK(CHostState__State_LoadGame, engine.dll + 0x16E730,
8784
void, __fastcall, (CHostState* self))
88-
// clang-format on
8985
{
9086
// singleplayer server starting
9187
// useless in 99% of cases but without it things could potentially break very much
@@ -109,10 +105,8 @@ void, __fastcall, (CHostState* self))
109105
g_pServerAuthentication->m_bNeedLocalAuthForNewgame = false;
110106
}
111107

112-
// clang-format off
113108
AUTOHOOK(CHostState__State_ChangeLevelMP, engine.dll + 0x16E520,
114109
void, __fastcall, (CHostState* self))
115-
// clang-format on
116110
{
117111
spdlog::info("HostState: ChangeLevelMP");
118112

@@ -125,10 +119,8 @@ void, __fastcall, (CHostState* self))
125119
g_pServerPresence->SetMap(g_pHostState->m_levelName);
126120
}
127121

128-
// clang-format off
129122
AUTOHOOK(CHostState__State_GameShutdown, engine.dll + 0x16E640,
130123
void, __fastcall, (CHostState* self))
131-
// clang-format on
132124
{
133125
spdlog::info("HostState: GameShutdown");
134126

@@ -153,10 +145,8 @@ void, __fastcall, (CHostState* self))
153145
}
154146
}
155147

156-
// clang-format off
157148
AUTOHOOK(CHostState__FrameUpdate, engine.dll + 0x16DB00,
158149
void, __fastcall, (CHostState* self, double flCurrentTime, float flFrameTime))
159-
// clang-format on
160150
{
161151
CHostState__FrameUpdate(self, flCurrentTime, flFrameTime);
162152

0 commit comments

Comments
 (0)