diff --git a/lib/squall b/lib/squall index 9722c1e..22e9686 160000 --- a/lib/squall +++ b/lib/squall @@ -1 +1 @@ -Subproject commit 9722c1e8c35e14e57f9a4f1e45806d8237df957b +Subproject commit 22e9686d64db308a9b480ecf6e1fba43c2563315 diff --git a/src/console/Device.cpp b/src/console/Device.cpp index 5a1df3b..2d87392 100644 --- a/src/console/Device.cpp +++ b/src/console/Device.cpp @@ -274,6 +274,7 @@ void ConsoleDeviceInitialize(const char* title) { s_requestedFormat.hwTnL = true; // TODO + s_requestedFormat.hwCursor = true; CGxFormat format; memcpy(&format, &s_requestedFormat, sizeof(s_requestedFormat)); diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index b60fc97..eeaa104 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -334,11 +334,17 @@ LRESULT CGxDeviceD3d::WindowProcD3d(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM case WM_SETCURSOR: { if (device) { - if (device->m_d3dDevice && lParam == 1) { + if (device->m_d3dDevice && LOWORD(lParam) == HTCLIENT) { SetCursor(nullptr); BOOL show = device->m_cursorVisible && device->m_hardwareCursor ? TRUE : FALSE; device->m_d3dDevice->ShowCursor(show); + } else { + // Uncomment when the "glove" cursor will be fixed + //break; } + } else { + // Uncomment when the "glove" cursor will be fixed + //break; } return 1; @@ -488,8 +494,7 @@ int32_t CGxDeviceD3d::DeviceSetFormat(const CGxFormat& format) { if (this->ICreateWindow(createFormat) && this->ICreateD3dDevice(createFormat) && this->CGxDevice::DeviceSetFormat(format)) { this->intF64 = 1; - - // TODO + this->m_hwCursorNeedsUpdate = 1; if (this->m_format.window == 0) { RECT windowRect; @@ -1249,6 +1254,11 @@ void CGxDeviceD3d::CursorSetVisible(int32_t visible) { } } +void CGxDeviceD3d::CursorUnlock(uint32_t x, uint32_t y) { + CGxDevice::CursorUnlock(x, y); + this->m_hwCursorNeedsUpdate = 1; +} + void CGxDeviceD3d::ICursorDraw() { if (!this->m_hardwareCursor) { this->ISceneBegin(); diff --git a/src/gx/d3d/CGxDeviceD3d.hpp b/src/gx/d3d/CGxDeviceD3d.hpp index 16c9f3e..ceeee09 100644 --- a/src/gx/d3d/CGxDeviceD3d.hpp +++ b/src/gx/d3d/CGxDeviceD3d.hpp @@ -252,6 +252,7 @@ class CGxDeviceD3d : public CGxDevice { virtual void ICursorDestroy(); virtual void ICursorDraw(); virtual void CursorSetVisible(int32_t visible); + virtual void CursorUnlock(uint32_t x, uint32_t y); virtual int32_t DeviceCreate(int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat& format); virtual int32_t DeviceSetFormat(const CGxFormat& format); virtual void* DeviceWindow();