Commit ddec94bf authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: Pass proper parameters to CheckDeviceFormat.

parent c1eabc2c
...@@ -1164,6 +1164,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1164,6 +1164,7 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
{ {
ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface); ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice7, iface);
HRESULT hr; HRESULT hr;
WINED3DDISPLAYMODE mode;
int i; int i;
WINED3DFORMAT FormatList[] = { WINED3DFORMAT FormatList[] = {
...@@ -1202,14 +1203,25 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1202,14 +1203,25 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
memset(&mode, 0, sizeof(mode));
hr = IWineD3DDevice_GetDisplayMode(This->ddraw->wineD3DDevice,
0,
&mode);
if(FAILED(hr)) {
LeaveCriticalSection(&ddraw_cs);
WARN("Cannot get the current adapter format\n");
return hr;
}
for(i = 0; i < sizeof(FormatList) / sizeof(WINED3DFORMAT); i++) for(i = 0; i < sizeof(FormatList) / sizeof(WINED3DFORMAT); i++)
{ {
hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D, hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D,
0 /* Adapter */, WINED3DADAPTER_DEFAULT,
0 /* DeviceType */, WINED3DDEVTYPE_HAL,
0 /* AdapterFormat */, mode.Format,
0 /* Usage */, 0 /* Usage */,
0 /* ResourceType */, WINED3DRTYPE_TEXTURE,
FormatList[i], FormatList[i],
SURFACE_OPENGL); SURFACE_OPENGL);
if(hr == D3D_OK) if(hr == D3D_OK)
...@@ -1234,11 +1246,11 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface, ...@@ -1234,11 +1246,11 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
for(i = 0; i < sizeof(BumpFormatList) / sizeof(WINED3DFORMAT); i++) for(i = 0; i < sizeof(BumpFormatList) / sizeof(WINED3DFORMAT); i++)
{ {
hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D, hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D,
0 /* Adapter */, WINED3DADAPTER_DEFAULT,
0 /* DeviceType */, WINED3DDEVTYPE_HAL,
0 /* AdapterFormat */, mode.Format,
WINED3DUSAGE_QUERY_LEGACYBUMPMAP, WINED3DUSAGE_QUERY_LEGACYBUMPMAP,
0 /* ResourceType */, WINED3DRTYPE_TEXTURE,
BumpFormatList[i], BumpFormatList[i],
SURFACE_OPENGL); SURFACE_OPENGL);
if(hr == D3D_OK) if(hr == D3D_OK)
...@@ -1317,6 +1329,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface, ...@@ -1317,6 +1329,7 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface); ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface);
HRESULT hr; HRESULT hr;
int i; int i;
WINED3DDISPLAYMODE mode;
WINED3DFORMAT FormatList[] = { WINED3DFORMAT FormatList[] = {
/* 32 bit */ /* 32 bit */
...@@ -1341,14 +1354,25 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface, ...@@ -1341,14 +1354,25 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
memset(&mode, 0, sizeof(mode));
hr = IWineD3DDevice_GetDisplayMode(This->ddraw->wineD3DDevice,
0,
&mode);
if(FAILED(hr)) {
LeaveCriticalSection(&ddraw_cs);
WARN("Cannot get the current adapter format\n");
return hr;
}
for(i = 0; i < sizeof(FormatList) / sizeof(WINED3DFORMAT); i++) for(i = 0; i < sizeof(FormatList) / sizeof(WINED3DFORMAT); i++)
{ {
hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D, hr = IWineD3D_CheckDeviceFormat(This->ddraw->wineD3D,
0 /* Adapter */, 0 /* Adapter */,
0 /* DeviceType */, WINED3DDEVTYPE_HAL,
0 /* AdapterFormat */, mode.Format,
0 /* Usage */, 0 /* Usage */,
0 /* ResourceType */, WINED3DRTYPE_TEXTURE,
FormatList[i], FormatList[i],
SURFACE_OPENGL); SURFACE_OPENGL);
if(hr == D3D_OK) if(hr == D3D_OK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment