add new .ini setting for hiding child windows
This commit is contained in:
parent
1fde0ef382
commit
b83005118d
3 changed files with 37 additions and 11 deletions
1
inc/dd.h
1
inc/dd.h
|
@ -25,6 +25,7 @@ HRESULT dd_CreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOute
|
|||
#define FIX_CHILDS_DISABLED 0
|
||||
#define FIX_CHILDS_DETECT 1
|
||||
#define FIX_CHILDS_DETECT_PAINT 2
|
||||
#define FIX_CHILDS_DETECT_HIDE 3
|
||||
|
||||
#define RESLIST_NORMAL 0
|
||||
#define RESLIST_MINI 1
|
||||
|
|
|
@ -329,7 +329,7 @@ static void cfg_create_ini()
|
|||
"; Note: Set this to 2 if your chosen resolution is not working, set to 1 if the game is crashing\n"
|
||||
"resolutions=0\n"
|
||||
"\n"
|
||||
"; Child window handling, possible values: 0 = Disabled, 1 = Display top left, 2 = Display top left + repaint\n"
|
||||
"; Child window handling, possible values: 0 = Disabled, 1 = Display top left, 2 = Display top left + repaint, 3 = Hide\n"
|
||||
"; Note: Disables upscaling if a child window was detected\n"
|
||||
"fixchilds=2\n"
|
||||
"\n"
|
||||
|
@ -417,8 +417,8 @@ static void cfg_create_ini()
|
|||
"\n"
|
||||
"; Blade & Sword\n"
|
||||
"[comeon]\n"
|
||||
"renderer=opengl\n"
|
||||
"nonexclusive=true\n"
|
||||
"fixchilds=3\n"
|
||||
"hook=3\n"
|
||||
"fixpitch=true\n"
|
||||
"\n"
|
||||
"; Blood II - The Chosen / Shogo - Mobile Armor Division\n"
|
||||
|
|
41
src/utils.c
41
src/utils.c
|
@ -1,5 +1,6 @@
|
|||
#include <windows.h>
|
||||
#include "ddraw.h"
|
||||
#include "debug.h"
|
||||
#include "dd.h"
|
||||
#include "ddsurface.h"
|
||||
#include "hook.h"
|
||||
|
@ -372,20 +373,44 @@ BOOL CALLBACK util_enum_child_proc(HWND hwnd, LPARAM lparam)
|
|||
|
||||
if (real_GetClientRect(hwnd, &size) && real_GetWindowRect(hwnd, &pos) && size.right > 1 && size.bottom > 1)
|
||||
{
|
||||
g_ddraw->got_child_windows = g_ddraw->child_window_exists = TRUE;
|
||||
//TRACE(" util_enum_child_proc right=%u, bottom=%u\n", size.right, size.bottom);
|
||||
|
||||
if (g_ddraw->fixchilds == FIX_CHILDS_DETECT_PAINT)
|
||||
if (g_ddraw->fixchilds == FIX_CHILDS_DETECT_HIDE)
|
||||
{
|
||||
HDC dst_dc = GetDC(hwnd);
|
||||
HDC src_dc;
|
||||
LONG style = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
|
||||
dds_GetDC(this, &src_dc);
|
||||
if (!(style & WS_EX_TRANSPARENT))
|
||||
{
|
||||
real_SetWindowLongA(hwnd, GWL_EXSTYLE, style | WS_EX_TRANSPARENT);
|
||||
|
||||
real_MapWindowPoints(HWND_DESKTOP, g_ddraw->hwnd, (LPPOINT)&pos, 2);
|
||||
real_SetWindowPos(
|
||||
hwnd,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ddraw->got_child_windows = g_ddraw->child_window_exists = TRUE;
|
||||
|
||||
BitBlt(dst_dc, 0, 0, size.right, size.bottom, src_dc, pos.left, pos.top, SRCCOPY);
|
||||
if (g_ddraw->fixchilds == FIX_CHILDS_DETECT_PAINT)
|
||||
{
|
||||
HDC dst_dc = GetDC(hwnd);
|
||||
HDC src_dc;
|
||||
|
||||
ReleaseDC(hwnd, dst_dc);
|
||||
dds_GetDC(this, &src_dc);
|
||||
|
||||
real_MapWindowPoints(HWND_DESKTOP, g_ddraw->hwnd, (LPPOINT)&pos, 2);
|
||||
|
||||
BitBlt(dst_dc, 0, 0, size.right, size.bottom, src_dc, pos.left, pos.top, SRCCOPY);
|
||||
|
||||
ReleaseDC(hwnd, dst_dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue