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

fix d9d9 clear issues on windows xp

This commit is contained in:
FunkyFr3sh 2021-11-05 18:36:50 +01:00
parent 37c8dc1d91
commit a5aa71ff3a

View File

@ -286,6 +286,7 @@ static BOOL d3d9_set_states()
}
}
/*
D3DVIEWPORT9 view_data = {
g_ddraw->render.viewport.x,
g_ddraw->render.viewport.y,
@ -295,7 +296,7 @@ static BOOL d3d9_set_states()
1.0f };
err = err || FAILED(IDirect3DDevice9_SetViewport(g_d3d9.device, &view_data));
*/
return !err;
}
@ -337,6 +338,7 @@ DWORD WINAPI d3d9_render_main(void)
fpsl_init();
BOOL needs_update = FALSE;
LONG clear_count = 0;
DWORD timeout = g_ddraw->render.minfps > 0 ? g_ddraw->render.minfps_tick_len : 200;
@ -349,6 +351,9 @@ DWORD WINAPI d3d9_render_main(void)
static int tex_index = 0, pal_index = 0;
if (InterlockedExchange(&g_ddraw->render.clear_screen, FALSE))
clear_count = 10;
fpsl_frame_start();
EnterCriticalSection(&g_ddraw->cs);
@ -416,11 +421,6 @@ DWORD WINAPI d3d9_render_main(void)
}
}
if (InterlockedExchange(&g_ddraw->render.clear_screen, FALSE))
{
IDirect3DDevice9_Clear(g_d3d9.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
}
if (g_ddraw->fixchilds)
{
g_ddraw->child_window_exists = FALSE;
@ -446,6 +446,12 @@ DWORD WINAPI d3d9_render_main(void)
LeaveCriticalSection(&g_ddraw->cs);
if (clear_count > 0)
{
clear_count--;
IDirect3DDevice9_Clear(g_d3d9.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
}
IDirect3DDevice9_BeginScene(g_d3d9.device);
IDirect3DDevice9_DrawPrimitive(g_d3d9.device, D3DPT_TRIANGLESTRIP, 0, 2);
IDirect3DDevice9_EndScene(g_d3d9.device);