diff --git a/src/d3d9/d3d9_cursor.cpp b/src/d3d9/d3d9_cursor.cpp index 16ec41d60c5..0224c776b4e 100644 --- a/src/d3d9/d3d9_cursor.cpp +++ b/src/d3d9/d3d9_cursor.cpp @@ -26,14 +26,14 @@ namespace dxvk { HRESULT D3D9Cursor::SetHardwareCursor(UINT XHotSpot, UINT YHotSpot, const CursorBitmap& bitmap) { - DWORD mask[32]; + CursorMask mask; std::memset(mask, ~0, sizeof(mask)); ICONINFO info; info.fIcon = FALSE; info.xHotspot = XHotSpot; info.yHotspot = YHotSpot; - info.hbmMask = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 1, mask); + info.hbmMask = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 1, &mask[0]); info.hbmColor = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 32, &bitmap[0]); if (m_hCursor != nullptr) diff --git a/src/d3d9/d3d9_cursor.h b/src/d3d9/d3d9_cursor.h index d69e3974803..b2ca5537d02 100644 --- a/src/d3d9/d3d9_cursor.h +++ b/src/d3d9/d3d9_cursor.h @@ -11,11 +11,20 @@ namespace dxvk { // Format Size of 4 bytes (ARGB) using CursorBitmap = uint8_t[HardwareCursorHeight * HardwareCursorPitch]; + // Monochrome mask (1 bit) + using CursorMask = uint8_t[HardwareCursorHeight * HardwareCursorWidth / 8]; class D3D9Cursor { public: +#ifdef _WIN32 + ~D3D9Cursor() { + if (m_hCursor != nullptr) + ::DestroyCursor(m_hCursor); + } +#endif + void UpdateCursor(int X, int Y); BOOL ShowCursor(BOOL bShow);