From cda5d668ad5c3e361fbdeba7c071967749709797 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 29 May 2022 18:51:24 +0200 Subject: [PATCH] Fix splash image --- src/client/component/console.cpp | 4 ++-- src/client/component/splash.cpp | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 3b671e51..97904ccc 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -41,10 +41,10 @@ namespace console MSG msg{}; while (!this->terminate_runner_) { - if (PeekMessageA(&msg, nullptr, NULL, NULL, PM_REMOVE)) + if (PeekMessageW(&msg, nullptr, NULL, NULL, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageW(&msg); } else { diff --git a/src/client/component/splash.cpp b/src/client/component/splash.cpp index 7cc211de..c758fec3 100644 --- a/src/client/component/splash.cpp +++ b/src/client/component/splash.cpp @@ -38,6 +38,19 @@ namespace splash this->show(); } + void pre_start() override + { + if(this->window_) + { + MSG msg{}; + while (PeekMessageW(&msg, nullptr, NULL, NULL, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + } + void pre_destroy() override { this->destroy(); @@ -90,7 +103,7 @@ namespace splash wnd_class.lpszMenuName = nullptr; wnd_class.lpfnWndProc = DefWindowProcA; wnd_class.hInstance = host; - wnd_class.hIcon = LoadIconA(host, reinterpret_cast(102)); + wnd_class.hIcon = LoadIconA(host, MAKEINTRESOURCEA(1)); wnd_class.hCursor = LoadCursorA(nullptr, IDC_APPSTARTING); wnd_class.hbrBackground = reinterpret_cast(6); wnd_class.lpszClassName = "Black Ops III Splash Screen"; @@ -131,6 +144,8 @@ namespace splash SetWindowPos(this->window_, nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER); + SetWindowRgn(this->window_, CreateRoundRectRgn(0, 0, rect.right - rect.left, rect.bottom - rect.top, 15, 15), TRUE); + ShowWindow(this->window_, SW_SHOW); UpdateWindow(this->window_); }