diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2024-09-01 18:44:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-01 19:44:04 +0200 |
commit | 96c34f64ab4ed6099d08f458178e4686dff96b00 (patch) | |
tree | f318d5597885d820562a8afc05d18189e9f4df6f /primedev/engine/gl_matsysiface.cpp | |
parent | f2d07f5d19d824194a6595455e577810b9d71762 (diff) | |
download | NorthstarLauncher-96c34f64ab4ed6099d08f458178e4686dff96b00.tar.gz NorthstarLauncher-96c34f64ab4ed6099d08f458178e4686dff96b00.zip |
Remove uses of Autohook from `gl_matsysiface.cpp` (#801)
Removes AUTOHOOK macro from gl_matsysiface.cpp and replaces it with HookAttach
Diffstat (limited to 'primedev/engine/gl_matsysiface.cpp')
-rw-r--r-- | primedev/engine/gl_matsysiface.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/primedev/engine/gl_matsysiface.cpp b/primedev/engine/gl_matsysiface.cpp index 903a0113..075a56ac 100644 --- a/primedev/engine/gl_matsysiface.cpp +++ b/primedev/engine/gl_matsysiface.cpp @@ -2,9 +2,8 @@ CMaterialGlue* (*GetMaterialAtCrossHair)(); -AUTOHOOK_INIT() - -AUTOHOOK(CC_mat_crosshair_printmaterial_f, engine.dll + 0xB3C40, void, __fastcall, (const CCommand& args)) +static void(__fastcall* o_pCC_mat_crosshair_printmaterial_f)(const CCommand& args) = nullptr; +static void __fastcall h_CC_mat_crosshair_printmaterial_f(const CCommand& args) { CMaterialGlue* pMat = GetMaterialAtCrossHair(); @@ -44,7 +43,8 @@ AUTOHOOK(CC_mat_crosshair_printmaterial_f, engine.dll + 0xB3C40, void, __fastcal ON_DLL_LOAD("engine.dll", GlMatSysIFace, (CModule module)) { - AUTOHOOK_DISPATCH() + o_pCC_mat_crosshair_printmaterial_f = module.Offset(0xB3C40).RCast<decltype(o_pCC_mat_crosshair_printmaterial_f)>(); + HookAttach(&(PVOID&)o_pCC_mat_crosshair_printmaterial_f, (PVOID)h_CC_mat_crosshair_printmaterial_f); GetMaterialAtCrossHair = module.Offset(0xB37D0).RCast<CMaterialGlue* (*)()>(); } |