Skip to content
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

Fixed bug where user can't select some resolutions in game #55

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/d3d9/d3d9_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,8 @@ namespace dxvk {
mode.Format = static_cast<D3DFORMAT>(Format);
mode.ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE;

m_modes.push_back(mode);
if (std::count(m_modes.begin(), m_modes.end(), mode) == 0)
m_modes.push_back(mode);
}

// Sort display modes by width, height and refresh rate,
Expand Down
67 changes: 38 additions & 29 deletions src/d3d9/d3d9_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,36 +209,37 @@ namespace dxvk {
bool IsDepthFormat(D3D9Format Format);

inline bool operator == (const D3DVIEWPORT9& a, const D3DVIEWPORT9& b) {
return a.X == b.X &&
a.Y == b.Y &&
a.Width == b.Width &&
a.Height == b.Height &&
a.MinZ == b.MinZ &&
a.MaxZ == b.MaxZ;
}

inline bool operator != (const D3DVIEWPORT9& a, const D3DVIEWPORT9& b) {
return !(a == b);
}

inline bool operator == (const RECT& a, const RECT& b) {
return a.left == b.left &&
a.right == b.right &&
a.top == b.top &&
a.bottom == b.bottom;
}
return a.X == b.X &&
a.Y == b.Y &&
a.Width == b.Width &&
a.Height == b.Height &&
a.MinZ == b.MinZ &&
a.MaxZ == b.MaxZ;
}

inline bool operator != (const D3DVIEWPORT9& a, const D3DVIEWPORT9& b) {
return !(a == b);
}

inline bool operator == (const RECT& a, const RECT& b) {
return a.left == b.left &&
a.right == b.right &&
a.top == b.top &&
a.bottom == b.bottom;
}

inline bool operator != (const RECT& a, const RECT& b) {
return !(a == b);
}

inline bool operator == (const POINT& a, const POINT& b) {
return a.x == b.x && a.y == b.y;
}

inline bool operator != (const POINT& a, const POINT& b) {
return !(a == b);
}

inline bool operator != (const RECT& a, const RECT& b) {
return !(a == b);
}

inline bool operator == (const POINT& a, const POINT& b) {
return a.x == b.x && a.y == b.y;
}

inline bool operator != (const POINT& a, const POINT& b) {
return !(a == b);
}

inline bool IsPoolManaged(D3DPOOL Pool) {
return Pool == D3DPOOL_MANAGED || Pool == D3DPOOL_MANAGED_EX;
Expand Down Expand Up @@ -299,4 +300,12 @@ namespace dxvk {
return D3D9TextureStageStateTypes(Type - 1);
}

}
inline bool operator == (const D3DDISPLAYMODEEX& a, const D3DDISPLAYMODEEX& b) {
return a.Size == b.Size &&
a.Width == b.Width &&
a.Height == b.Height &&
a.RefreshRate == b.RefreshRate &&
a.Format == b.Format &&
a.ScanLineOrdering == b.ScanLineOrdering;
}