diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index a829594..e8b55e4 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -1,5 +1,5 @@ if(WHOA_SYSTEM_WIN) - file(GLOB PRIVATE_SOURCES "win/*.cpp") + file(GLOB PRIVATE_SOURCES "win/*.cpp" "win/Whoa.rc") add_executable(Whoa WIN32 ${PRIVATE_SOURCES}) diff --git a/src/app/win/Whoa.cur b/src/app/win/Whoa.cur new file mode 100644 index 0000000..299f575 Binary files /dev/null and b/src/app/win/Whoa.cur differ diff --git a/src/app/win/Whoa.ico b/src/app/win/Whoa.ico new file mode 100644 index 0000000..fed8f93 Binary files /dev/null and b/src/app/win/Whoa.ico differ diff --git a/src/app/win/Whoa.rc b/src/app/win/Whoa.rc new file mode 100644 index 0000000..ee59167 --- /dev/null +++ b/src/app/win/Whoa.rc @@ -0,0 +1,2 @@ +BlizzardIcon.ico ICON DISCARDABLE "Whoa.ico" +BlizzardCursor.cur CURSOR "Whoa.cur" diff --git a/src/console/Device.cpp b/src/console/Device.cpp index ad3402d..2761c66 100644 --- a/src/console/Device.cpp +++ b/src/console/Device.cpp @@ -6,6 +6,7 @@ #include "event/Input.hpp" #include "gx/Device.hpp" #include +#include CVar* s_cvGxMaximize; CVar* s_cvGxResolution; @@ -297,6 +298,9 @@ void ConsoleDeviceInitialize(const char* title) { } } + // Log + printf("GxApi_%s selected\n", g_gxApiNames[api]); + // Set internally (CVar value reflects the current gxApi at launch), // this will not Set() as CVar gxApi is latched s_cvGxApi->InternalSet(g_gxApiNames[api], true, false, false, true); diff --git a/src/gx/Device.cpp b/src/gx/Device.cpp index 7eb4f13..f22dd88 100644 --- a/src/gx/Device.cpp +++ b/src/gx/Device.cpp @@ -1,15 +1,17 @@ #include "gx/Device.hpp" #include "gx/CGxDevice.hpp" #include "gx/Gx.hpp" +#include CGxDevice* g_theGxDevicePtr = nullptr; CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam), const CGxFormat& format) { - CGxDevice* device; + CGxDevice* device = nullptr; switch (api) { case GxApi_OpenGl: device = CGxDevice::NewOpenGl(); + break; #if defined(WHOA_SYSTEM_WIN) case GxApi_D3d9: @@ -41,6 +43,8 @@ CGxDevice* GxDevCreate(EGxApi api, int32_t (*windowProc)(void* window, uint32_t break; } + STORM_ASSERT(device != nullptr); + g_theGxDevicePtr = device; if (g_theGxDevicePtr->DeviceCreate(windowProc, format)) { diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index cfb655e..b0b8804 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -333,7 +333,18 @@ LRESULT CGxDeviceD3d::WindowProcD3d(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM } case WM_SETCURSOR: { - // TODO + if (device) { + if (device->m_d3dDevice && lParam == 1) { + SetCursor(nullptr); + BOOL show = TRUE; + // if (device->unk2904[0x13] == 0) || (device->.unk2904[0x14] == 0)) { + // show = FALSE; + // } else { + // show = TRUE; + // } + device->m_d3dDevice->ShowCursor(show); + } + } return 1; }