=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: ddraw: Set correct HEL and HAL color models.
Alexandre Julliard
julliard at winehq.org
Tue Nov 15 13:17:32 CST 2011
Module: wine
Branch: master
Commit: 9e0baa55cec232656048c972e94a9dc2a15ec30b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9e0baa55cec232656048c972e94a9dc2a15ec30b
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Mon Oct 17 22:14:54 2011 +0200
ddraw: Set correct HEL and HAL color models.
---
dlls/ddraw/ddraw.c | 7 +++++++
dlls/ddraw/tests/d3d.c | 12 ++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 8fdda89..5d4b008 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -3968,6 +3968,9 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
| D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE);
hal_desc.dpcTriCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2
| D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE);
+ /* RGB, RAMP and MMX devices have a HAL dcmColorModel of 0 */
+ hal_desc.dcmColorModel = 0;
+
hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
device_name, &hal_desc, &hel_desc, context);
if (hr != D3DENUMRET_OK)
@@ -3983,11 +3986,15 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
TRACE("Enumerating HAL Direct3D device.\n");
hal_desc = device_desc1;
hel_desc = device_desc1;
+
/* The hal device does not have the pow2 flag set in hel, but in hal. */
hel_desc.dpcLineCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2
| D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE);
hel_desc.dpcTriCaps.dwTextureCaps &= ~(D3DPTEXTURECAPS_POW2
| D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE);
+ /* HAL devices have a HEL dcmColorModel of 0 */
+ hel_desc.dcmColorModel = 0;
+
hr = callback((GUID *)&IID_IDirect3DHALDevice, wined3d_description,
device_name, &hal_desc, &hel_desc, context);
if (hr != D3DENUMRET_OK)
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
index 4cd9346..4a45867 100644
--- a/dlls/ddraw/tests/d3d.c
+++ b/dlls/ddraw/tests/d3d.c
@@ -804,10 +804,15 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid,LPSTR DeviceDescription,LPS
"RGB Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"RGB Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
+
+ ok(hal->dcmColorModel == 0, "RGB Device %u hal caps has colormodel %u\n", ver, hal->dcmColorModel);
+ ok(hel->dcmColorModel == D3DCOLOR_RGB, "RGB Device %u hel caps has colormodel %u\n", ver, hel->dcmColorModel);
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, Guid))
{
trace("HAL Device %d\n", ver);
+ ok(hal->dcmColorModel == D3DCOLOR_RGB, "HAL Device %u hal caps has colormodel %u\n", ver, hel->dcmColorModel);
+ ok(hel->dcmColorModel == 0, "HAL Device %u hel caps has colormodel %u\n", ver, hel->dcmColorModel);
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, Guid))
{
@@ -848,6 +853,10 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid,LPSTR DeviceDescription,LPS
"Ramp Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"Ramp Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
+
+ ok(hal->dcmColorModel == 0, "Ramp Device %u hal caps has colormodel %u\n", ver, hal->dcmColorModel);
+ ok(hel->dcmColorModel == D3DCOLOR_MONO, "Ramp Device %u hel caps has colormodel %u\n",
+ ver, hel->dcmColorModel);
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, Guid))
{
@@ -868,6 +877,9 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid,LPSTR DeviceDescription,LPS
"MMX Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"MMX Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
+
+ ok(hal->dcmColorModel == 0, "MMX Device %u hal caps has colormodel %u\n", ver, hal->dcmColorModel);
+ ok(hel->dcmColorModel == D3DCOLOR_RGB, "MMX Device %u hel caps has colormodel %u\n", ver, hel->dcmColorModel);
}
else
{
More information about the wine-cvs
mailing list