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

center in windowed mode + clear

This commit is contained in:
FunkyFr3sh 2021-11-08 02:36:28 +01:00
parent 8c6b2814a9
commit 87d3fb169a
3 changed files with 12 additions and 2 deletions

View File

@ -445,6 +445,8 @@ DWORD WINAPI d3d9_render_main(void)
if (g_ddraw->bnet_active)
{
IDirect3DDevice9_Clear(g_d3d9.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
RECT rc = { 0,0,g_ddraw->width,g_ddraw->height };
if (SUCCEEDED(IDirect3DTexture9_LockRect(g_d3d9.surface_tex[tex_index], 0, &lock_rc, &rc, 0)))

View File

@ -704,6 +704,8 @@ static void ogl_render()
if (g_ddraw->bnet_active)
{
glClear(GL_COLOR_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, g_ogl.surface_tex_ids[tex_index]);
if (g_ogl.adjust_alignment)

View File

@ -693,8 +693,14 @@ HWND WINAPI fake_CreateWindowExA(
int align_y = added_height > 0 ? added_height / 2 : 0;
int align_x = added_width > 0 ? added_width / 2 : 0;
X += pt.x;// +align_x;
Y += pt.y;// +align_y;
if (g_ddraw->windowed)
{
X += align_x;
Y += align_y;
}
X += pt.x;
Y += pt.y;
dwStyle |= WS_CLIPCHILDREN;
}