mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 01:24:11 +01:00
[d3d9] Fix device reset handling when no cursor is set
This commit is contained in:
parent
d39d879838
commit
c8759418af
@ -11,7 +11,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (m_hCursor != nullptr)
|
if (m_hCursor != nullptr)
|
||||||
ResetHardwareCursor();
|
ResetHardwareCursor();
|
||||||
else
|
else if (IsSoftwareCursor())
|
||||||
ResetSoftwareCursor();
|
ResetSoftwareCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,12 +48,12 @@ namespace dxvk {
|
|||||||
|
|
||||||
BOOL D3D9Cursor::ShowCursor(BOOL bShow) {
|
BOOL D3D9Cursor::ShowCursor(BOOL bShow) {
|
||||||
// Cursor visibility remains unchanged (typically FALSE) if the cursor isn't set.
|
// 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))
|
if (unlikely(m_hCursor == nullptr && !IsSoftwareCursor()))
|
||||||
return m_visible;
|
return m_visible;
|
||||||
|
|
||||||
if (m_hCursor != nullptr)
|
if (m_hCursor != nullptr)
|
||||||
::SetCursor(bShow ? m_hCursor : nullptr);
|
::SetCursor(bShow ? m_hCursor : nullptr);
|
||||||
else
|
else if (likely(!m_sCursor.ResetCursor))
|
||||||
m_sCursor.DrawCursor = bShow;
|
m_sCursor.DrawCursor = bShow;
|
||||||
|
|
||||||
return std::exchange(m_visible, bShow);
|
return std::exchange(m_visible, bShow);
|
||||||
@ -95,10 +95,11 @@ namespace dxvk {
|
|||||||
if (m_hCursor != nullptr)
|
if (m_hCursor != nullptr)
|
||||||
ResetHardwareCursor();
|
ResetHardwareCursor();
|
||||||
|
|
||||||
m_sCursor.Width = Width;
|
m_sCursor.Width = Width;
|
||||||
m_sCursor.Height = Height;
|
m_sCursor.Height = Height;
|
||||||
m_sCursor.X = XHotSpot;
|
m_sCursor.X = XHotSpot;
|
||||||
m_sCursor.Y = YHotSpot;
|
m_sCursor.Y = YHotSpot;
|
||||||
|
m_sCursor.ResetCursor = false;
|
||||||
|
|
||||||
ShowCursor(m_visible);
|
ShowCursor(m_visible);
|
||||||
|
|
||||||
@ -110,14 +111,17 @@ namespace dxvk {
|
|||||||
Logger::warn("D3D9Cursor::ResetCursor: Not supported on current platform.");
|
Logger::warn("D3D9Cursor::ResetCursor: Not supported on current platform.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9Cursor::ResetHardwareCursor() {
|
void D3D9Cursor::ResetHardwareCursor() {
|
||||||
Logger::warn("D3D9Cursor::ResetHardwareCursor: Not supported on current platform.");
|
Logger::warn("D3D9Cursor::ResetHardwareCursor: Not supported on current platform.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9Cursor::ResetSoftwareCursor() {
|
void D3D9Cursor::ResetSoftwareCursor() {
|
||||||
Logger::warn("D3D9Cursor::ResetSoftwareCursor: Not supported on current platform.");
|
Logger::warn("D3D9Cursor::ResetSoftwareCursor: Not supported on current platform.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9Cursor::UpdateCursor(int X, int Y) {
|
void D3D9Cursor::UpdateCursor(int X, int Y) {
|
||||||
Logger::warn("D3D9Cursor::UpdateCursor: Not supported on current platform.");
|
Logger::warn("D3D9Cursor::UpdateCursor: Not supported on current platform.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user