r5sdk/r5dev/vphysics/QHull.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

34 lines
1.5 KiB
C++

#pragma once
inline CMemory p_QHull_PrintFunc;
inline int(*v_QHull_PrintFunc)(const char* fmt, ...);
//inline CMemory p_speex_warning_int;
//inline int(*speex_warning_int)(FILE* stream, const char* format, ...);
///////////////////////////////////////////////////////////////////////////////
int QHull_PrintFunc(const char* fmt, ...);
///////////////////////////////////////////////////////////////////////////////
class VQHull : public IDetour
{
virtual void GetAdr(void) const
{
LogFunAdr("QHull_PrintFunc", p_QHull_PrintFunc.GetPtr());
//LogFunAdr("speex_warning_int", p_speex_warning_int.GetPtr());
}
virtual void GetFun(void) const
{
p_QHull_PrintFunc = g_GameDll.FindPatternSIMD("48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 B8 40 27 ?? ?? ?? ?? ?? ?? ?? 48");
v_QHull_PrintFunc = p_QHull_PrintFunc.RCast<int (*)(const char* fmt, ...)>(); /*48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 B8 40 27 00 00 ?? ?? ?? ?? 00 48*/
//p_speex_warning_int = g_GameDll.FindPatternSIMD("48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 56 57 48 83 EC 30 48 8B FA 48 8D 74 24 60 48 8B");
//speex_warning_int = p_speex_warning_int.RCast<int (*)(FILE* stream, const char* format, ...)>(); /*48 89 54 24 10 4C 89 44 24 18 4C 89 4C 24 20 53 56 57 48 83 EC 30 48 8B FA 48 8D 74 24 60 48 8B*/
}
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Attach(void) const;
virtual void Detach(void) const;
};
///////////////////////////////////////////////////////////////////////////////