1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d9] Fix (most) cursor-related Wine tests

This commit is contained in:
WinterSnowfall 2024-10-05 17:44:46 +03:00 committed by Philip Rebohle
parent 7ff5321910
commit bbe82aa534
2 changed files with 15 additions and 1 deletions

View File

@ -40,6 +40,10 @@ namespace dxvk {
BOOL D3D9Cursor::ShowCursor(BOOL bShow) {
// Cursor visibility remains unchanged (typically FALSE) if the cursor isn't set.
if (unlikely(m_hCursor == nullptr && m_sCursor.Width == 0 && m_sCursor.Height == 0))
return m_visible;
if (likely(m_hCursor != nullptr))
::SetCursor(bShow ? m_hCursor : nullptr);

View File

@ -345,9 +345,19 @@ namespace dxvk {
uint32_t inputWidth = cursorTex->Desc()->Width;
uint32_t inputHeight = cursorTex->Desc()->Height;
// Always use a hardware cursor when windowed.
// Check if surface dimensions are powers of two.
if ((inputWidth && (inputWidth & (inputWidth - 1)))
|| (inputHeight && (inputHeight & (inputHeight - 1))))
return D3DERR_INVALIDCALL;
D3DPRESENT_PARAMETERS params;
m_implicitSwapchain->GetPresentParameters(&params);
if (inputWidth > params.BackBufferWidth
|| inputHeight > params.BackBufferHeight)
return D3DERR_INVALIDCALL;
// Always use a hardware cursor when windowed.
bool hwCursor = params.Windowed;
// Always use a hardware cursor w/h <= 32 px