Skip to content

Commit

Permalink
修改static_cast 修改错误的调试遗留代码 修改snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
RERASER committed Sep 19, 2024
1 parent accd8af commit 15d0a26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
14 changes: 4 additions & 10 deletions src/client/component/iidx/custom_resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/client/component/iidx/d3d9_proxy/interface_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions src/client/launcher/launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(launcher::game::count) || game_index <= static_cast<int>(launcher::game::invalid))
{
return {};
}
auto gamemeta = ::game::environment::gamemeta::get_gamemeta((launcher::game)game_index);
auto gamemeta = ::game::environment::gamemeta::get_gamemeta(static_cast<launcher::game>(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<launcher::game>(game_index));
j1["installed"] = gamemeta.get_install_state();
if (gamemeta.get_install_state())
{
Expand Down
8 changes: 4 additions & 4 deletions src/client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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");

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 15d0a26

Please sign in to comment.