1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

add experimental wing32 hooks

This commit is contained in:
FunkyFr3sh 2024-05-27 01:15:30 +02:00
parent bbab7a018a
commit 9ced91af14
3 changed files with 59 additions and 0 deletions

View File

@ -40,6 +40,12 @@ int WINAPI fake_GetDeviceCaps(HDC hdc, int index);
BOOL WINAPI fake_StretchBlt(
HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, DWORD rop);
BOOL WINAPI fake_WinGStretchBlt(
HDC hdcDest, int xDest, int yDest, int wDest, int hDest, HDC hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc);
BOOL WINAPI fake_WinGBitBlt(
HDC hdc, int x, int y, int cx, int cy, HDC hdcSrc, int x1, int y1);
BOOL WINAPI fake_BitBlt(
HDC hdc, int x, int y, int cx, int cy, HDC hdcSrc, int x1, int y1, DWORD rop);

View File

@ -138,6 +138,16 @@ HOOKLIST g_hook_hooklist[] =
{ "", NULL, NULL, 0 }
}
},
/*
{
"WING32.DLL",
{
{ "WinGBitBlt", (PROC)fake_WinGBitBlt, NULL, HOOK_SKIP_2 },
{ "WinGStretchBlt", (PROC)fake_WinGStretchBlt, NULL, HOOK_SKIP_2 },
{ "", NULL, NULL, 0 }
}
},
*/
{
"kernel32.dll",
{

View File

@ -823,6 +823,21 @@ BOOL WINAPI fake_StretchBlt(
return real_StretchBlt(hdcDest, xDest, yDest, wDest, hDest, hdcSrc, xSrc, ySrc, wSrc, hSrc, rop);
}
BOOL WINAPI fake_WinGStretchBlt(
HDC hdcDest,
int xDest,
int yDest,
int wDest,
int hDest,
HDC hdcSrc,
int xSrc,
int ySrc,
int wSrc,
int hSrc)
{
return fake_StretchBlt(hdcDest, xDest, yDest, wDest, hDest, hdcSrc, xSrc, ySrc, wSrc, hSrc, SRCCOPY);
}
BOOL WINAPI fake_BitBlt(
HDC hdc,
int x,
@ -860,11 +875,39 @@ BOOL WINAPI fake_BitBlt(
return result;
}
}
else if (g_ddraw.width > 0 && g_ddraw.render.hdc)
{
return real_StretchBlt(
g_ddraw.render.hdc,
x + g_ddraw.render.viewport.x,
y + g_ddraw.render.viewport.y,
(int)(cx * g_ddraw.render.scale_w),
(int)(cy * g_ddraw.render.scale_h),
hdcSrc,
x1,
y1,
cx,
cy,
rop);
}
}
return real_BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, rop);
}
BOOL WINAPI fake_WinGBitBlt(
HDC hdc,
int x,
int y,
int cx,
int cy,
HDC hdcSrc,
int x1,
int y1)
{
return fake_BitBlt(hdc, x, y, cx, cy, hdcSrc, x1, y1, SRCCOPY);
}
int WINAPI fake_SetDIBitsToDevice(
HDC hdc,
int xDest,