-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
加入版本号检测 修复全屏报错 #5
Changes from 1 commit
a28db4f
accd8af
15d0a26
3081277
eee64b3
d93ad9b
fb3a700
5dc8afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,16 +15,23 @@ namespace iidx::custom_resolution | |
{ | ||
static auto w = mode() == 1 ? | ||
GetSystemMetrics(SM_CXSCREEN) : std::stoi(game::environment::get_param("IIDX_RESOLTION_W")); | ||
|
||
return w; | ||
if (w == 0)//不知道为什么本机分辨率的时候参数会为0 总之在这处理一下 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. w = w ? w : GetSystemMetrics(SM_CXSCREEN) |
||
{ | ||
return GetSystemMetrics(SM_CXSCREEN); | ||
} | ||
return 1920; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. w |
||
} | ||
|
||
int height() | ||
{ | ||
static auto h = mode() == 1 ? | ||
GetSystemMetrics(SM_CYSCREEN) : std::stoi(game::environment::get_param("IIDX_RESOLTION_H")); | ||
if (h == 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
{ | ||
return GetSystemMetrics(SM_CYSCREEN); | ||
} | ||
|
||
return h; | ||
return 1200; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. h |
||
} | ||
|
||
namespace | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,15 @@ d3d9ex_proxy::d3d9ex_proxy(IDirect3D9Ex* orig) | |
{ | ||
this->m_d3d = orig; | ||
|
||
D3DDISPLAYMODE _D3DDISPLAYMODE{}; | ||
|
||
orig->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &_D3DDISPLAYMODE); | ||
|
||
if (_D3DDISPLAYMODE.RefreshRate>=120) | ||
{ | ||
has120hz = true; | ||
} | ||
|
||
DEVMODE dm{ | ||
.dmSize = sizeof(DEVMODE), | ||
.dmDriverExtra = 0, | ||
|
@@ -87,26 +96,26 @@ UINT __stdcall d3d9ex_proxy::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) | |
|
||
HRESULT __stdcall d3d9ex_proxy::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) | ||
{ | ||
if (iidx::custom_resolution::mode() != 0 && (has120hz || has119hz || has60hz || has59hz)) | ||
if (iidx::custom_resolution::mode() != 0 || (has120hz || has119hz || has60hz || has59hz)) | ||
{ | ||
pMode->Format = Format; | ||
pMode->Width = 1920; | ||
pMode->Height = 1080; | ||
pMode->Width = iidx::custom_resolution::width(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个1920x1080是有原因的 不能改 |
||
pMode->Height = iidx::custom_resolution::height(); | ||
|
||
if (Mode) | ||
return D3DERR_INVALIDCALL; | ||
|
||
if (has120hz) | ||
pMode->RefreshRate = 120; | ||
|
||
if (has119hz) | ||
pMode->RefreshRate = 119; | ||
if (has59hz) | ||
pMode->RefreshRate = 59; | ||
|
||
if (has60hz) | ||
pMode->RefreshRate = 60; | ||
|
||
if (has59hz) | ||
pMode->RefreshRate = 59; | ||
if (has119hz) | ||
pMode->RefreshRate = 119; | ||
|
||
if (has120hz) | ||
pMode->RefreshRate = 120; | ||
|
||
return D3D_OK; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接换掉原来的