From 487e78a7088cb5f50ca249e8b1bc0833e7f0992d Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Fri, 12 Jul 2024 23:09:33 +0200 Subject: [PATCH] fix upscaling in AOE2 --- inc/version.h | 2 +- src/utils.c | 21 +++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/inc/version.h b/inc/version.h index 088c32b..62c616d 100644 --- a/inc/version.h +++ b/inc/version.h @@ -7,7 +7,7 @@ #define VERSION_MAJOR 6 #define VERSION_MINOR 7 #define VERSION_BUILD 0 -#define VERSION_REVISION 0 +#define VERSION_REVISION 1 #define VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION #define VERSION_STRING ver_str(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION) diff --git a/src/utils.c b/src/utils.c index f983cd0..a1e8bf7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -624,31 +624,24 @@ BOOL CALLBACK util_enum_child_proc(HWND hwnd, LPARAM lparam) RECT size; RECT pos; - if (real_GetClientRect(hwnd, &size) && - real_GetWindowRect(hwnd, &pos) && - size.right > 1 && - size.bottom > 1) + if (real_GetClientRect(hwnd, &size) && real_GetWindowRect(hwnd, &pos)) { char class_name[MAX_PATH] = { 0 }; GetClassNameA(hwnd, class_name, sizeof(class_name) - 1); - LONG style = real_GetWindowLongA(hwnd, GWL_STYLE); LONG exstyle = real_GetWindowLongA(hwnd, GWL_EXSTYLE); - -#ifdef _DEBUG_X HWND parent = GetParent(hwnd); - TRACE("util_enum_child_proc class=%s, hwnd=%p, width=%u, height=%u, left=%d, top=%d, parent=%p\n", - class_name, hwnd, size.right, size.bottom, pos.left, pos.top, parent); +#ifdef _DEBUG_X + LONG style = real_GetWindowLongA(hwnd, GWL_STYLE); + + TRACE("util_enum_child_proc class=%s, hwnd=%p, width=%u, height=%u, left=%d, top=%d, parent=%p, style=%08X\n", + class_name, hwnd, size.right, size.bottom, pos.left, pos.top, parent, style); dbg_dump_wnd_styles(style, exstyle); - - if (parent != g_ddraw.hwnd) - return TRUE; #endif - /* Atrox */ - if (style == 0x500100C4 && strcmp(class_name, "Edit") == 0) + if (parent != g_ddraw.hwnd || size.right <= 1 || size.bottom <= 1 || strcmp(class_name, "Edit") == 0) return TRUE; if (g_config.fixchilds == FIX_CHILDS_DETECT_HIDE ||