diff options
Diffstat (limited to 'Source/Core/DolphinNoGUI/PlatformWin32.cpp')
| -rw-r--r-- | Source/Core/DolphinNoGUI/PlatformWin32.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/Core/DolphinNoGUI/PlatformWin32.cpp b/Source/Core/DolphinNoGUI/PlatformWin32.cpp index c78c563d5d..7304332682 100644 --- a/Source/Core/DolphinNoGUI/PlatformWin32.cpp +++ b/Source/Core/DolphinNoGUI/PlatformWin32.cpp @@ -3,16 +3,13 @@ #include "DolphinNoGUI/Platform.h" -#include "Common/MsgHandler.h" #include "Core/Config/MainSettings.h" #include "Core/ConfigManager.h" #include "Core/Core.h" -#include "Core/State.h" #include "Core/System.h" #include <Windows.h> #include <climits> -#include <cstdio> #include <dwmapi.h> #include "VideoCommon/Present.h" @@ -20,7 +17,7 @@ namespace { -class PlatformWin32 : public Platform +class PlatformWin32 final : public Platform { public: ~PlatformWin32() override; @@ -29,14 +26,14 @@ public: void SetTitle(const std::string& string) override; void MainLoop() override; - WindowSystemInfo GetWindowSystemInfo() const; + WindowSystemInfo GetWindowSystemInfo() const override; private: static constexpr TCHAR WINDOW_CLASS_NAME[] = _T("DolphinNoGUI"); static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - bool RegisterRenderWindowClass(); + static bool RegisterRenderWindowClass(); bool CreateRenderWindow(); void UpdateWindowPosition(); void ProcessEvents(); @@ -66,7 +63,7 @@ bool PlatformWin32::RegisterRenderWindowClass() wc.hInstance = GetModuleHandle(nullptr); wc.hIcon = LoadIcon(nullptr, IDI_ICON1); wc.hCursor = LoadCursor(nullptr, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1); wc.lpszMenuName = nullptr; wc.lpszClassName = WINDOW_CLASS_NAME; wc.hIconSm = LoadIcon(nullptr, IDI_ICON1); @@ -168,7 +165,8 @@ void PlatformWin32::ProcessEvents() } } -LRESULT PlatformWin32::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +LRESULT PlatformWin32::WndProc(const HWND hwnd, const UINT msg, const WPARAM wParam, + const LPARAM lParam) { PlatformWin32* platform = reinterpret_cast<PlatformWin32*>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); switch (msg) @@ -185,7 +183,7 @@ LRESULT PlatformWin32::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam if (hwnd) { // Remove rounded corners from the render window on Windows 11 - const DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND; + constexpr DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND; DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference, sizeof(corner_preference)); } |
