Skip to content

Commit

Permalink
Detours: Clean up a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
bolrog committed Apr 29, 2021
1 parent 43da3d2 commit b28108d
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions src/d2dx/Detours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,41 +426,13 @@ void d2dx::AttachLateDetours(

DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());

if (D2Gfx_DrawImage_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawImage_Real, D2Gfx_DrawImage_Hooked);
}

if (D2Gfx_DrawShiftedImage_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawShiftedImage_Real, D2Gfx_DrawShiftedImage_Hooked);
}

if (D2Gfx_DrawVerticalCropImage_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawVerticalCropImage_Real, D2Gfx_DrawVerticalCropImage_Hooked);
}

if (D2Gfx_DrawClippedImage_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawClippedImage_Real, D2Gfx_DrawClippedImage_Hooked);
}

if (D2Gfx_DrawImageFast_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawImageFast_Real, D2Gfx_DrawImageFast_Hooked);
}

if (D2Gfx_DrawShadow_Real)
{
DetourAttach(&(PVOID&)D2Gfx_DrawShadow_Real, D2Gfx_DrawShadow_Hooked);
}

if (D2Win_DrawText_Real)
{
DetourAttach(&(PVOID&)D2Win_DrawText_Real, D2Win_DrawText_Hooked);
}
DetourAttach(&(PVOID&)D2Gfx_DrawImage_Real, D2Gfx_DrawImage_Hooked);
DetourAttach(&(PVOID&)D2Gfx_DrawShiftedImage_Real, D2Gfx_DrawShiftedImage_Hooked);
DetourAttach(&(PVOID&)D2Gfx_DrawVerticalCropImage_Real, D2Gfx_DrawVerticalCropImage_Hooked);
DetourAttach(&(PVOID&)D2Gfx_DrawClippedImage_Real, D2Gfx_DrawClippedImage_Hooked);
DetourAttach(&(PVOID&)D2Gfx_DrawImageFast_Real, D2Gfx_DrawImageFast_Hooked);
DetourAttach(&(PVOID&)D2Gfx_DrawShadow_Real, D2Gfx_DrawShadow_Hooked);
DetourAttach(&(PVOID&)D2Win_DrawText_Real, D2Win_DrawText_Hooked);

LONG lError = DetourTransactionCommit();

Expand Down

0 comments on commit b28108d

Please sign in to comment.