r5sdk/r5dev/game/server/physics_main.h
Kawe Mazidjatari 87f9420889 Globally reduce the use of auto for function pointer declarations
Find regex pattern:
inline auto ([a-zA-Z0-9_]+) = ([a-zA-Z0-9_]+)\.RCast<([a-zA-Z0-9_:<>*]+) *\(\*\)\(([^)]*)\)>\(\);
Replace regex pattern:
inline $3(*$1)($4);

This commit also removes the unnecessary initialization (which was required to type the auto variables),
and therefore removed 6kb of unnecessary dynamic initialization code.
2023-07-02 23:01:29 +02:00

33 lines
1.1 KiB
C++

//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PHYSICS_MAIN_H
#define PHYSICS_MAIN_H
inline CMemory p_Physics_RunThinkFunctions;
inline void(*v_Physics_RunThinkFunctions)(bool bSimulating);
///////////////////////////////////////////////////////////////////////////////
class VPhysics_Main : public IDetour
{
virtual void GetAdr(void) const
{
LogFunAdr("Physics_RunThinkFunctions", p_Physics_RunThinkFunctions.GetPtr());
}
virtual void GetFun(void) const
{
p_Physics_RunThinkFunctions = g_GameDll.FindPatternSIMD("88 4C 24 08 55 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ??");
v_Physics_RunThinkFunctions = p_Physics_RunThinkFunctions.RCast<void (*)(bool)>();
}
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Attach(void) const;
virtual void Detach(void) const;
};
///////////////////////////////////////////////////////////////////////////////
#endif // PHYSICS_MAIN_H