mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Return current display mode in GetAdapterDisplayModeEx rather than last mode
Fixes fullscreen at < native res in Vampire: The Masquerade Bloodlines 1/2
This commit is contained in:
parent
845ab2b5af
commit
91574993df
@ -667,15 +667,34 @@ namespace dxvk {
|
|||||||
HRESULT D3D9Adapter::GetAdapterDisplayModeEx(
|
HRESULT D3D9Adapter::GetAdapterDisplayModeEx(
|
||||||
D3DDISPLAYMODEEX* pMode,
|
D3DDISPLAYMODEEX* pMode,
|
||||||
D3DDISPLAYROTATION* pRotation) {
|
D3DDISPLAYROTATION* pRotation) {
|
||||||
|
if (pMode == nullptr)
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
if (pRotation != nullptr)
|
if (pRotation != nullptr)
|
||||||
*pRotation = D3DDISPLAYROTATION_IDENTITY;
|
*pRotation = D3DDISPLAYROTATION_IDENTITY;
|
||||||
|
|
||||||
D3DDISPLAYMODEFILTER filter;
|
MONITORINFOEXW monInfo = { };
|
||||||
filter.Size = sizeof(filter);
|
monInfo.cbSize = sizeof(monInfo);
|
||||||
filter.Format = D3DFMT_X8R8G8B8;
|
|
||||||
filter.ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE;
|
|
||||||
|
|
||||||
return this->EnumAdapterModesEx(&filter, 0, pMode);
|
if (!::GetMonitorInfoW(GetDefaultMonitor(), reinterpret_cast<MONITORINFO*>(&monInfo)))
|
||||||
|
throw DxvkError("D3D9Adapter::GetAdapterDisplayModeEx: Failed to query monitor info");
|
||||||
|
|
||||||
|
DEVMODEW devMode = DEVMODEW();
|
||||||
|
devMode.dmSize = sizeof(devMode);
|
||||||
|
|
||||||
|
if (!::EnumDisplaySettingsW(monInfo.szDevice, ENUM_CURRENT_SETTINGS, &devMode)) {
|
||||||
|
Logger::err("D3D9Adapter::GetAdapterDisplayModeEx: Failed to enum display settings");
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
pMode->Size = sizeof(D3DDISPLAYMODEEX);
|
||||||
|
pMode->Width = devMode.dmPelsWidth;
|
||||||
|
pMode->Height = devMode.dmPelsHeight;
|
||||||
|
pMode->RefreshRate = devMode.dmDisplayFrequency;
|
||||||
|
pMode->Format = D3DFMT_X8R8G8B8;
|
||||||
|
pMode->ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE;
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user