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

fix stretching for Genie Engine

This commit is contained in:
FunkyFr3sh 2018-11-22 13:39:03 +01:00
parent 054e5d604b
commit 0d9c038a18

View File

@ -107,23 +107,23 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)
{
ChildWindowExists = TRUE;
IDirectDrawSurfaceImpl *this = (IDirectDrawSurfaceImpl *)lParam;
HDC hDC = GetDC(hWnd);
RECT size;
GetClientRect(hWnd, &size);
RECT pos;
GetWindowRect(hWnd, &pos);
MapWindowPoints(HWND_DESKTOP, ddraw->hWnd, (LPPOINT)&pos, 2);
if (GetClientRect(hWnd, &size) && GetWindowRect(hWnd, &pos) && size.right > 1 && size.bottom > 1)
{
ChildWindowExists = TRUE;
BitBlt(hDC, 0, 0, size.right, size.bottom, this->hDC, pos.left, pos.top, SRCCOPY);
HDC hDC = GetDC(hWnd);
ReleaseDC(hWnd, hDC);
MapWindowPoints(HWND_DESKTOP, ddraw->hWnd, (LPPOINT)&pos, 2);
BitBlt(hDC, 0, 0, size.right, size.bottom, this->hDC, pos.left, pos.top, SRCCOPY);
ReleaseDC(hWnd, hDC);
}
return FALSE;
}