2022-10-23 01:20:49 +02:00
|
|
|
#pragma once
|
2022-08-09 17:18:07 +02:00
|
|
|
#include "public/ivrenderview.h"
|
2022-04-29 20:12:54 +02:00
|
|
|
|
2024-04-05 16:45:05 +02:00
|
|
|
inline CMemory P_DrawDepthOfField;
|
|
|
|
inline void*(*V_DrawDepthOfField)(const float a1);
|
|
|
|
|
2022-04-29 20:12:54 +02:00
|
|
|
inline CMemory P_DrawWorldMeshes;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void*(*V_DrawWorldMeshes)(void* baseEntity, void* renderContext, DrawWorldLists_t worldLists);
|
2022-04-29 20:12:54 +02:00
|
|
|
|
|
|
|
inline CMemory P_DrawWorldMeshesDepthOnly;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void*(*V_DrawWorldMeshesDepthOnly)(void* renderContext, DrawWorldLists_t worldLists);
|
2022-04-29 20:12:54 +02:00
|
|
|
|
|
|
|
inline CMemory P_DrawWorldMeshesDepthAtTheEnd;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void*(*V_DrawWorldMeshesDepthAtTheEnd)(void* ptr1, void* ptr2, void* ptr3, DrawWorldLists_t worldLists);
|
2022-04-29 20:12:54 +02:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VGL_RSurf : public IDetour
|
2022-04-29 20:12:54 +02:00
|
|
|
{
|
|
|
|
virtual void GetAdr(void) const
|
|
|
|
{
|
2024-04-05 16:45:05 +02:00
|
|
|
LogFunAdr("R_DrawDepthOfField", P_DrawDepthOfField.GetPtr());
|
2023-01-25 02:26:52 +01:00
|
|
|
LogFunAdr("R_DrawWorldMeshes", P_DrawWorldMeshes.GetPtr());
|
|
|
|
LogFunAdr("R_DrawWorldMeshesDepthOnly", P_DrawWorldMeshesDepthOnly.GetPtr());
|
|
|
|
LogFunAdr("R_DrawWorldMeshesDepthAtTheEnd", P_DrawWorldMeshesDepthAtTheEnd.GetPtr());
|
2022-04-29 20:12:54 +02:00
|
|
|
}
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2024-04-05 16:45:05 +02:00
|
|
|
P_DrawDepthOfField = g_GameDll.FindPatternSIMD("48 83 EC 48 0F 28 E8");
|
2022-04-29 20:12:54 +02:00
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-12-01 22:44:55 +01:00
|
|
|
P_DrawWorldMeshes = g_GameDll.FindPatternSIMD("48 8B C4 48 89 48 08 53 48 83 EC 70");
|
2022-04-29 20:12:54 +02:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-12-01 22:44:55 +01:00
|
|
|
P_DrawWorldMeshes = g_GameDll.FindPatternSIMD("48 8B C4 48 89 48 08 53 57 41 55");
|
2022-04-29 20:12:54 +02:00
|
|
|
#endif
|
2022-12-01 22:44:55 +01:00
|
|
|
P_DrawWorldMeshesDepthOnly = g_GameDll.FindPatternSIMD("40 56 57 B8 ?? ?? ?? ??");
|
|
|
|
P_DrawWorldMeshesDepthAtTheEnd = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B 0D ?? ?? ?? ?? 41 8B F9");
|
2022-04-29 20:12:54 +02:00
|
|
|
|
2024-04-05 16:45:05 +02:00
|
|
|
V_DrawDepthOfField = P_DrawDepthOfField.RCast<void* (*)(const float)>();
|
2022-04-29 22:07:30 +02:00
|
|
|
V_DrawWorldMeshes = P_DrawWorldMeshes.RCast<void* (*)(void*, void*, DrawWorldLists_t)>(); /*48 8B C4 48 89 48 08 53 57 41 55*/
|
|
|
|
V_DrawWorldMeshesDepthOnly = P_DrawWorldMeshesDepthOnly.RCast<void* (*)(void*, DrawWorldLists_t)>(); /*40 56 57 B8 ?? ?? ?? ??*/
|
|
|
|
V_DrawWorldMeshesDepthAtTheEnd = P_DrawWorldMeshesDepthAtTheEnd.RCast<void* (*)(void*, void*, void*, DrawWorldLists_t)>(); /*48 89 5C 24 ?? 48 89 74 24 ? 57 48 83 EC 20 48 8B 0D ?? ?? ?? ?? 41 8B F9*/
|
2022-04-29 20:12:54 +02:00
|
|
|
}
|
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
virtual void GetCon(void) const { }
|
2023-11-26 13:21:20 +01:00
|
|
|
virtual void Detour(const bool bAttach) const;
|
2022-04-29 20:12:54 +02:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|