From 15d0a2676e541df02e40c9a8b7bbfbb91dff1120 Mon Sep 17 00:00:00 2001 From: RERASER <2641320887@qq.com> Date: Thu, 19 Sep 2024 13:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9static=5Fcast=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=99=E8=AF=AF=E7=9A=84=E8=B0=83=E8=AF=95=E9=81=97?= =?UTF-8?q?=E7=95=99=E4=BB=A3=E7=A0=81=20=E4=BF=AE=E6=94=B9snake=5Fcase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/component/iidx/custom_resolution.cpp | 14 ++++---------- .../component/iidx/d3d9_proxy/interface_ex.cpp | 4 ++-- src/client/launcher/launcher.cpp | 6 +++--- src/client/main.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/client/component/iidx/custom_resolution.cpp b/src/client/component/iidx/custom_resolution.cpp index 3b538f2..1afbf17 100644 --- a/src/client/component/iidx/custom_resolution.cpp +++ b/src/client/component/iidx/custom_resolution.cpp @@ -15,23 +15,17 @@ namespace iidx::custom_resolution { static auto w = mode() == 1 ? GetSystemMetrics(SM_CXSCREEN) : std::stoi(game::environment::get_param("IIDX_RESOLTION_W")); - if (w == 0)//不知道为什么本机分辨率的时候参数会为0 总之在这处理一下 - { - return GetSystemMetrics(SM_CXSCREEN); - } - return 1920; + w = w ? w : GetSystemMetrics(SM_CXSCREEN); + return w; } int height() { static auto h = mode() == 1 ? GetSystemMetrics(SM_CYSCREEN) : std::stoi(game::environment::get_param("IIDX_RESOLTION_H")); - if (h == 0) - { - return GetSystemMetrics(SM_CYSCREEN); - } + h = h ? h : GetSystemMetrics(SM_CXSCREEN); - return 1200; + return h; } namespace diff --git a/src/client/component/iidx/d3d9_proxy/interface_ex.cpp b/src/client/component/iidx/d3d9_proxy/interface_ex.cpp index 0e9256e..67ed232 100644 --- a/src/client/component/iidx/d3d9_proxy/interface_ex.cpp +++ b/src/client/component/iidx/d3d9_proxy/interface_ex.cpp @@ -187,8 +187,8 @@ HRESULT __stdcall d3d9ex_proxy::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceTy { IDirect3DDevice9Ex* device = nullptr; - pPresentationParameters->BackBufferWidth = iidx::custom_resolution::width(); - pPresentationParameters->BackBufferHeight = iidx::custom_resolution::height(); + pPresentationParameters->BackBufferWidth = 1920; + pPresentationParameters->BackBufferHeight = 1080; if (iidx::custom_resolution::mode() != 0) { diff --git a/src/client/launcher/launcher.cpp b/src/client/launcher/launcher.cpp index 15e5b3e..93adc0e 100644 --- a/src/client/launcher/launcher.cpp +++ b/src/client/launcher/launcher.cpp @@ -114,14 +114,14 @@ void launcher::create_main_menu() { try { - if (game_index >= (int)launcher::game::count || game_index <= (int)launcher::game::invalid) + if (game_index >= static_cast(launcher::game::count) || game_index <= static_cast(launcher::game::invalid)) { return {}; } - auto gamemeta = ::game::environment::gamemeta::get_gamemeta((launcher::game)game_index); + auto gamemeta = ::game::environment::gamemeta::get_gamemeta(static_cast(game_index)); nlohmann::json j1; j1["game_type"] = game_index; - j1["game_name"] = ::game::environment::get_string((launcher::game)game_index); + j1["game_name"] = ::game::environment::get_string(static_cast(game_index)); j1["installed"] = gamemeta.get_install_state(); if (gamemeta.get_install_state()) { diff --git a/src/client/main.cpp b/src/client/main.cpp index cba023f..f22f43c 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -160,7 +160,7 @@ launcher::game detect_game_from_arguments() } -void enableEcoQoS() { +void enable_eco_qos() { auto sharedUserData = (BYTE*)0x7FFE0000; auto major = *(ULONG*)(sharedUserData + 0x26c); //auto minor = *(ULONG*)(sharedUserData + 0x270); @@ -181,7 +181,7 @@ void enableEcoQoS() { } } -void disableEcoQoS() { +void enable_high_qos() { auto sharedUserData = (BYTE*)0x7FFE0000; auto major = *(ULONG*)(sharedUserData + 0x26c); //auto minor = *(ULONG*)(sharedUserData + 0x270); @@ -206,7 +206,7 @@ int main() { FARPROC entry_point; enable_dpi_awareness(); - enableEcoQoS(); + enable_eco_qos(); // pin system dinput8 here to prevent old client from loading LoadLibraryA("dinput8.dll"); @@ -234,7 +234,7 @@ int main() return 0; } - disableEcoQoS(); + enable_high_qos(); try_set_game_environment(game); component_loader::create_components(game::environment::get_game());