From 348a90b54535ea13120f9c4489b3ed6d96addc89 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 22 Dec 2024 22:52:03 +0100 Subject: [PATCH] adjust logging --- src/winapi_hooks.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index 4cc83992e..5ad4afe60 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -1450,20 +1450,22 @@ UINT WINAPI fake_GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LP HPALETTE WINAPI fake_SelectPalette(HDC hdc, HPALETTE hPal, BOOL bForceBkgd) { + TRACE_EXT( + "%s(hdc=%p, hPal=%p, bForceBkgd=%d) [%p]\n", + __FUNCTION__, + hdc, + hPal, + bForceBkgd, + _ReturnAddress()); + if (g_ddraw.ref && g_ddraw.bpp == 8 && ((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow())) { + TRACE(" Display DC\n"); + if (g_ddraw.primary && g_ddraw.primary->palette) { - TRACE_EXT( - "%s(hdc=%p, hPal=%p, bForceBkgd=%d) [%p]\n", - __FUNCTION__, - hdc, - hPal, - bForceBkgd, - _ReturnAddress()); - g_ddraw.primary->selected_pal_count = GetPaletteEntries(hPal, 0, 256, g_ddraw.primary->selected_pal); return real_SelectPalette(g_ddraw.primary->hdc, hPal, bForceBkgd);; @@ -1475,14 +1477,16 @@ HPALETTE WINAPI fake_SelectPalette(HDC hdc, HPALETTE hPal, BOOL bForceBkgd) UINT WINAPI fake_RealizePalette(HDC hdc) { + TRACE_EXT("%s(hdc=%p) [%p]\n", __FUNCTION__, hdc, _ReturnAddress()); + if (g_ddraw.ref && g_ddraw.bpp == 8 && ((g_ddraw.hwnd && WindowFromDC(hdc) == g_ddraw.hwnd) || WindowFromDC(hdc) == GetDesktopWindow())) { + TRACE(" Display DC\n"); + if (g_ddraw.primary && g_ddraw.primary->palette) { - TRACE_EXT("%s(hdc=%p) [%p]\n", __FUNCTION__, hdc, _ReturnAddress()); - if (g_ddraw.primary->selected_pal_count != 256) { TRACE_EXT(" selected_pal_count = %u\n", g_ddraw.primary->selected_pal_count);