Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fdb85423
Commit
fdb85423
authored
Jun 20, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Lie about the display format in wined3d_get_adapter_display_mode().
parent
2a0463ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
directx.c
dlls/wined3d/directx.c
+17
-3
No files found.
dlls/wined3d/directx.c
View file @
fdb85423
...
@@ -3029,15 +3029,18 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
...
@@ -3029,15 +3029,18 @@ HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT ada
HRESULT
CDECL
wined3d_get_adapter_display_mode
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
HRESULT
CDECL
wined3d_get_adapter_display_mode
(
const
struct
wined3d
*
wined3d
,
UINT
adapter_idx
,
struct
wined3d_display_mode
*
mode
)
struct
wined3d_display_mode
*
mode
)
{
{
const
struct
wined3d_adapter
*
adapter
;
TRACE
(
"wined3d %p, adapter_idx %u, display_mode %p.
\n
"
,
wined3d
,
adapter_idx
,
mode
);
TRACE
(
"wined3d %p, adapter_idx %u, display_mode %p.
\n
"
,
wined3d
,
adapter_idx
,
mode
);
if
(
!
mode
||
adapter_idx
>=
wined3d
->
adapter_count
)
if
(
!
mode
||
adapter_idx
>=
wined3d
->
adapter_count
)
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
adapter
=
&
wined3d
->
adapters
[
adapter_idx
];
if
(
!
adapter_idx
)
if
(
!
adapter_idx
)
{
{
DEVMODEW
DevModeW
;
DEVMODEW
DevModeW
;
unsigned
int
bpp
;
ZeroMemory
(
&
DevModeW
,
sizeof
(
DevModeW
));
ZeroMemory
(
&
DevModeW
,
sizeof
(
DevModeW
));
DevModeW
.
dmSize
=
sizeof
(
DevModeW
);
DevModeW
.
dmSize
=
sizeof
(
DevModeW
);
...
@@ -3045,11 +3048,22 @@ HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UI
...
@@ -3045,11 +3048,22 @@ HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UI
EnumDisplaySettingsExW
(
NULL
,
ENUM_CURRENT_SETTINGS
,
&
DevModeW
,
0
);
EnumDisplaySettingsExW
(
NULL
,
ENUM_CURRENT_SETTINGS
,
&
DevModeW
,
0
);
mode
->
width
=
DevModeW
.
dmPelsWidth
;
mode
->
width
=
DevModeW
.
dmPelsWidth
;
mode
->
height
=
DevModeW
.
dmPelsHeight
;
mode
->
height
=
DevModeW
.
dmPelsHeight
;
bpp
=
DevModeW
.
dmBitsPerPel
;
mode
->
refresh_rate
=
DEFAULT_REFRESH_RATE
;
mode
->
refresh_rate
=
DEFAULT_REFRESH_RATE
;
if
(
DevModeW
.
dmFields
&
DM_DISPLAYFREQUENCY
)
if
(
DevModeW
.
dmFields
&
DM_DISPLAYFREQUENCY
)
mode
->
refresh_rate
=
DevModeW
.
dmDisplayFrequency
;
mode
->
refresh_rate
=
DevModeW
.
dmDisplayFrequency
;
mode
->
format_id
=
pixelformat_for_depth
(
bpp
);
mode
->
format_id
=
pixelformat_for_depth
(
DevModeW
.
dmBitsPerPel
);
/* Lie about the format. X11 can't change the color depth, and some
* apps are pretty angry if they SetDisplayMode from 24 to 16 bpp and
* find out that GetDisplayMode still returns 24 bpp. This should
* probably be handled in winex11 instead. */
if
(
adapter
->
screen_format
&&
adapter
->
screen_format
!=
mode
->
format_id
)
{
WARN
(
"Overriding format %s with stored format %s.
\n
"
,
debug_d3dformat
(
mode
->
format_id
),
debug_d3dformat
(
adapter
->
screen_format
));
mode
->
format_id
=
adapter
->
screen_format
;
}
}
}
else
else
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment