Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
8a5b6df4
Commit
8a5b6df4
authored
17 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d: Enumerate palettized formats for ddraw.
parent
3d92b293
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/d3d9/directx.c
+8
-2
8 additions, 2 deletions
dlls/d3d9/directx.c
dlls/ddraw/ddraw.c
+57
-26
57 additions, 26 deletions
dlls/ddraw/ddraw.c
dlls/wined3d/directx.c
+11
-0
11 additions, 0 deletions
dlls/wined3d/directx.c
with
76 additions
and
28 deletions
dlls/d3d9/directx.c
+
8
−
2
View file @
8a5b6df4
...
...
@@ -98,14 +98,20 @@ static HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UIN
static
UINT
WINAPI
IDirect3D9Impl_GetAdapterModeCount
(
LPDIRECT3D9
iface
,
UINT
Adapter
,
D3DFORMAT
Format
)
{
IDirect3D9Impl
*
This
=
(
IDirect3D9Impl
*
)
iface
;
/* Others than that not supported by d3d9, but reported by wined3d for ddraw. Filter them out */
if
(
Format
!=
D3DFMT_X8R8G8B8
&&
Format
!=
D3DFMT_R5G6B5
&&
Format
!=
D3DFMT_UNKNOWN
)
{
return
0
;
}
return
IWineD3D_GetAdapterModeCount
(
This
->
WineD3D
,
Adapter
,
Format
);
}
static
HRESULT
WINAPI
IDirect3D9Impl_EnumAdapterModes
(
LPDIRECT3D9
iface
,
UINT
Adapter
,
D3DFORMAT
Format
,
UINT
Mode
,
D3DDISPLAYMODE
*
pMode
)
{
IDirect3D9Impl
*
This
=
(
IDirect3D9Impl
*
)
iface
;
/* We can't pass this to WineD3D, otherwise it'll think it came from D3D8.
/* We can't pass this to WineD3D, otherwise it'll think it came from D3D8
or DDraw
.
It's supposed to fail anyway, so no harm returning failure. */
if
(
Format
=
=
D3DFMT_
UNKNOWN
)
if
(
Format
!
=
WINE
D3DFMT_
X8R8G8B8
&&
Format
!=
WINED3DFMT_R5G6B5
)
return
D3DERR_INVALIDCALL
;
return
IWineD3D_EnumAdapterModes
(
This
->
WineD3D
,
Adapter
,
Format
,
Mode
,
(
WINED3DDISPLAYMODE
*
)
pMode
);
}
...
...
This diff is collapsed.
Click to expand it.
dlls/ddraw/ddraw.c
+
57
−
26
View file @
8a5b6df4
...
...
@@ -1166,11 +1166,31 @@ IDirectDrawImpl_EnumDisplayModes(IDirectDraw7 *iface,
LPDDENUMMODESCALLBACK2
cb
)
{
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw7
,
iface
);
unsigned
int
modenum
=
0
;
unsigned
int
modenum
,
fmt
;
WINED3DFORMAT
pixelformat
=
WINED3DFMT_UNKNOWN
;
WINED3DDISPLAYMODE
mode
;
DDSURFACEDESC2
callback_sd
;
WINED3DFORMAT
checkFormatList
[]
=
{
WINED3DFMT_R8G8B8
,
WINED3DFMT_A8R8G8B8
,
WINED3DFMT_X8R8G8B8
,
WINED3DFMT_R5G6B5
,
WINED3DFMT_X1R5G5B5
,
WINED3DFMT_A1R5G5B5
,
WINED3DFMT_A4R4G4B4
,
WINED3DFMT_R3G3B2
,
WINED3DFMT_A8R3G3B2
,
WINED3DFMT_X4R4G4B4
,
WINED3DFMT_A2B10G10R10
,
WINED3DFMT_A8B8G8R8
,
WINED3DFMT_X8B8G8R8
,
WINED3DFMT_A2R10G10B10
,
WINED3DFMT_A8P8
,
WINED3DFMT_P8
};
TRACE
(
"(%p)->(%p,%p,%p): Relay
\n
"
,
This
,
DDSD
,
Context
,
cb
);
/* This looks sane */
...
...
@@ -1182,41 +1202,52 @@ IDirectDrawImpl_EnumDisplayModes(IDirectDraw7 *iface,
pixelformat
=
PixelFormat_DD2WineD3D
(
&
DDSD
->
u4
.
ddpfPixelFormat
);
}
while
(
IWineD3D_EnumAdapterModes
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
pixelformat
,
modenum
++
,
&
mode
)
==
WINED3D_OK
)
{
if
(
DDSD
)
for
(
fmt
=
0
;
fmt
<
(
sizeof
(
checkFormatList
)
/
sizeof
(
checkFormatList
[
0
]));
fmt
++
)
{
if
(
pixelformat
!=
WINED3DFMT_UNKNOWN
&&
checkFormatList
[
fmt
]
!=
pixelformat
)
{
if
(
DDSD
->
dwFlags
&
DDSD_WIDTH
&&
mode
.
Width
!=
DDSD
->
dwWidth
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_HEIGHT
&&
mode
.
Height
!=
DDSD
->
dwHeight
)
continue
;
continue
;
}
m
emset
(
&
callback_sd
,
0
,
sizeof
(
callback_sd
))
;
callback_sd
.
dwSize
=
sizeof
(
callback_sd
);
callback_sd
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
callback_sd
.
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
|
DDSD_PITCH
;
if
(
Flags
&
DDEDM_REFRESHRATES
)
m
odenum
=
0
;
while
(
IWineD3D_EnumAdapterModes
(
This
->
wineD3D
,
WINED3DADAPTER_DEFAULT
,
checkFormatList
[
fmt
],
modenum
++
,
&
mode
)
==
WINED3D_OK
)
{
callback_sd
.
dwFlags
|=
DDSD_REFRESHRATE
;
callback_sd
.
u2
.
dwRefreshRate
=
mode
.
RefreshRate
;
}
if
(
DDSD
)
{
if
(
DDSD
->
dwFlags
&
DDSD_WIDTH
&&
mode
.
Width
!=
DDSD
->
dwWidth
)
continue
;
if
(
DDSD
->
dwFlags
&
DDSD_HEIGHT
&&
mode
.
Height
!=
DDSD
->
dwHeight
)
continue
;
}
callback_sd
.
dwWidth
=
mode
.
Width
;
callback_sd
.
dwHeight
=
mode
.
Height
;
memset
(
&
callback_sd
,
0
,
sizeof
(
callback_sd
));
callback_sd
.
dwSize
=
sizeof
(
callback_sd
);
callback_sd
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
PixelFormat_WineD3DtoDD
(
&
callback_sd
.
u4
.
ddpfPixelFormat
,
mode
.
Format
);
callback_sd
.
dwFlags
=
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
|
DDSD_PITCH
;
if
(
Flags
&
DDEDM_REFRESHRATES
)
{
callback_sd
.
dwFlags
|=
DDSD_REFRESHRATE
;
callback_sd
.
u2
.
dwRefreshRate
=
mode
.
RefreshRate
;
}
TRACE
(
"Enumerating %dx%d@%d
\n
"
,
callback_sd
.
dwWidth
,
callback_sd
.
dwHeight
,
callback_sd
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
);
callback_sd
.
dwWidth
=
mode
.
Width
;
callback_sd
.
dwHeight
=
mode
.
Height
;
if
(
cb
(
&
callback_sd
,
Context
)
==
DDENUMRET_CANCEL
)
{
TRACE
(
"Application asked to terminate the enumeration
\n
"
);
return
DD_OK
;
PixelFormat_WineD3DtoDD
(
&
callback_sd
.
u4
.
ddpfPixelFormat
,
mode
.
Format
);
TRACE
(
"Enumerating %dx%d@%d
\n
"
,
callback_sd
.
dwWidth
,
callback_sd
.
dwHeight
,
callback_sd
.
u4
.
ddpfPixelFormat
.
u1
.
dwRGBBitCount
);
if
(
cb
(
&
callback_sd
,
Context
)
==
DDENUMRET_CANCEL
)
{
TRACE
(
"Application asked to terminate the enumeration
\n
"
);
return
DD_OK
;
}
}
}
TRACE
(
"End of enumeration
\n
"
);
return
DD_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/wined3d/directx.c
+
11
−
0
View file @
8a5b6df4
...
...
@@ -1117,6 +1117,7 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
switch
(
Format
)
{
case
WINED3DFMT_UNKNOWN
:
/* This is for D3D8, do not enumerate P8 here */
if
(
DevModeW
.
dmBitsPerPel
==
32
||
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
break
;
...
...
@@ -1126,6 +1127,9 @@ static UINT WINAPI IWineD3DImpl_GetAdapterModeCount(IWineD3D *iface, UINT Ad
case
WINED3DFMT_R5G6B5
:
if
(
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
break
;
case
WINED3DFMT_P8
:
if
(
DevModeW
.
dmBitsPerPel
==
8
)
i
++
;
break
;
default:
/* Skip other modes as they do not match the requested format */
break
;
...
...
@@ -1169,6 +1173,7 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
switch
(
Format
)
{
case
WINED3DFMT_UNKNOWN
:
/* This is D3D8. Do not enumerate P8 here */
if
(
DevModeW
.
dmBitsPerPel
==
32
||
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
break
;
...
...
@@ -1178,6 +1183,9 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
case
WINED3DFMT_R5G6B5
:
if
(
DevModeW
.
dmBitsPerPel
==
16
)
i
++
;
break
;
case
WINED3DFMT_P8
:
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
));
...
...
@@ -1203,6 +1211,9 @@ static HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapte
{
switch
(
DevModeW
.
dmBitsPerPel
)
{
case
8
:
pMode
->
Format
=
WINED3DFMT_P8
;
break
;
case
16
:
pMode
->
Format
=
WINED3DFMT_R5G6B5
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment