1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Fixed GDI brush origin

Fixes splash window background alignment in Star Trek: Armada.
See issue #94.
This commit is contained in:
narzoul 2021-05-13 23:00:23 +02:00
parent 83143589ee
commit 9fa1a8a047
2 changed files with 14 additions and 1 deletions

View File

@ -90,7 +90,7 @@ namespace
POINT brushOrg = {};
GetBrushOrgEx(origDc, &brushOrg);
SetBrushOrgEx(compatDc.dc, brushOrg.x, brushOrg.y, nullptr);
SetBrushOrgEx(compatDc.dc, origin.x + brushOrg.x, origin.y + brushOrg.y, nullptr);
POINT currentPos = {};
GetCurrentPositionEx(origDc, &currentPos);

View File

@ -156,6 +156,19 @@ namespace
}
break;
case WM_ERASEBKGND:
{
HBRUSH brush = reinterpret_cast<HBRUSH>(GetClassLong(hwnd, GCL_HBRBACKGROUND));
if (!brush)
{
return FALSE;
}
RECT rect = {};
GetClientRect(hwnd, &rect);
FillRect(Gdi::CompatDc(reinterpret_cast<HDC>(wParam)), &rect, brush);
return TRUE;
}
case WM_NCACTIVATE:
return onNcActivate(hwnd, wParam, lParam);