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
b85a0705
Commit
b85a0705
authored
Dec 09, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Support more formats for display mode enumeration.
ddraw/d3d8/d3d9 only support a limited number of formats, but those already limit the supported formats themselves.
parent
b3defd4c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
39 deletions
+20
-39
directx.c
dlls/wined3d/directx.c
+19
-39
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/directx.c
View file @
b85a0705
...
@@ -2199,6 +2199,8 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
...
@@ -2199,6 +2199,8 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
/* TODO: Store modes per adapter and read it from the adapter structure */
/* TODO: Store modes per adapter and read it from the adapter structure */
if
(
Adapter
==
0
)
{
/* Display */
if
(
Adapter
==
0
)
{
/* Display */
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
Format
,
&
This
->
adapters
[
Adapter
].
gl_info
);
UINT
format_bits
=
format_desc
->
byte_count
*
CHAR_BIT
;
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
unsigned
int
j
=
0
;
unsigned
int
j
=
0
;
DEVMODEW
mode
;
DEVMODEW
mode
;
...
@@ -2209,28 +2211,15 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
...
@@ -2209,28 +2211,15 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
while
(
EnumDisplaySettingsExW
(
NULL
,
j
,
&
mode
,
0
))
while
(
EnumDisplaySettingsExW
(
NULL
,
j
,
&
mode
,
0
))
{
{
++
j
;
++
j
;
switch
(
Format
)
if
(
Format
==
WINED3DFMT_UNKNOWN
)
{
{
case
WINED3DFMT_UNKNOWN
:
/* This is for D3D8, do not enumerate P8 here */
/* This is for D3D8, do not enumerate P8 here */
if
(
mode
.
dmBitsPerPel
==
32
||
mode
.
dmBitsPerPel
==
16
)
++
i
;
if
(
mode
.
dmBitsPerPel
==
32
||
mode
.
dmBitsPerPel
==
16
)
++
i
;
break
;
}
else
if
(
mode
.
dmBitsPerPel
==
format_bits
)
case
WINED3DFMT_B8G8R8X8_UNORM
:
{
if
(
mode
.
dmBitsPerPel
==
32
)
++
i
;
++
i
;
break
;
case
WINED3DFMT_B5G6R5_UNORM
:
if
(
mode
.
dmBitsPerPel
==
16
)
++
i
;
break
;
case
WINED3DFMT_P8_UINT
:
if
(
mode
.
dmBitsPerPel
==
8
)
++
i
;
break
;
default:
/* Skip other modes as they do not match the requested format */
break
;
}
}
}
}
...
@@ -2257,6 +2246,8 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
...
@@ -2257,6 +2246,8 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
/* TODO: Store modes per adapter and read it from the adapter structure */
/* TODO: Store modes per adapter and read it from the adapter structure */
if
(
Adapter
==
0
)
if
(
Adapter
==
0
)
{
{
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
Format
,
&
This
->
adapters
[
Adapter
].
gl_info
);
UINT
format_bits
=
format_desc
->
byte_count
*
CHAR_BIT
;
DEVMODEW
DevModeW
;
DEVMODEW
DevModeW
;
int
ModeIdx
=
0
;
int
ModeIdx
=
0
;
UINT
i
=
0
;
UINT
i
=
0
;
...
@@ -2268,27 +2259,16 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
...
@@ -2268,27 +2259,16 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
/* If we are filtering to a specific format (D3D9), then need to skip
/* If we are filtering to a specific format (D3D9), then need to skip
all unrelated modes, but if mode is irrelevant (D3D8), then we can
all unrelated modes, but if mode is irrelevant (D3D8), then we can
just count through the ones with valid bit depths */
just count through the ones with valid bit depths */
while
((
i
<=
Mode
)
&&
EnumDisplaySettingsExW
(
NULL
,
j
++
,
&
DevModeW
,
0
))
{
while
((
i
<=
Mode
)
&&
EnumDisplaySettingsExW
(
NULL
,
j
++
,
&
DevModeW
,
0
))
switch
(
Format
)
{
{
case
WINED3DFMT_UNKNOWN
:
if
(
Format
==
WINED3DFMT_UNKNOWN
)
/* This is D3D8. Do not enumerate P8 here */
{
if
(
DevModeW
.
dmBitsPerPel
==
32
||
/* This is for D3D8, do not enumerate P8 here */
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
if
(
DevModeW
.
dmBitsPerPel
==
32
||
DevModeW
.
dmBitsPerPel
==
16
)
++
i
;
break
;
}
case
WINED3DFMT_B8G8R8X8_UNORM
:
else
if
(
DevModeW
.
dmBitsPerPel
==
format_bits
)
if
(
DevModeW
.
dmBitsPerPel
==
32
)
i
++
;
{
break
;
++
i
;
case
WINED3DFMT_B5G6R5_UNORM
:
if
(
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
break
;
case
WINED3DFMT_P8_UINT
:
if
(
DevModeW
.
dmBitsPerPel
==
8
)
i
++
;
break
;
default:
/* Modes that don't match what we support can get an early-out */
TRACE_
(
d3d_caps
)(
"Searching for %s, returning D3DERR_INVALIDCALL
\n
"
,
debug_d3dformat
(
Format
));
return
WINED3DERR_INVALIDCALL
;
}
}
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
b85a0705
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <stdarg.h>
#include <stdarg.h>
#include <math.h>
#include <math.h>
#include <limits.h>
#define NONAMELESSUNION
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define NONAMELESSSTRUCT
#define COBJMACROS
#define COBJMACROS
...
...
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