Commit 39ae94d0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Present parameters are an array when D3DCREATE_ADAPTERGROUP_DEVICE is specified.

parent 40d4f9b7
...@@ -376,7 +376,8 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap ...@@ -376,7 +376,8 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap
IDirect3D9Impl *This = (IDirect3D9Impl *)iface; IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
IDirect3DDevice9Impl *object = NULL; IDirect3DDevice9Impl *object = NULL;
WINED3DPRESENT_PARAMETERS localParameters; WINED3DPRESENT_PARAMETERS *localParameters;
UINT i, count = 1;
HRESULT hr; HRESULT hr;
TRACE("(%p) Relay\n", This); TRACE("(%p) Relay\n", This);
...@@ -412,49 +413,64 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap ...@@ -412,49 +413,64 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap
TRACE("(%p) : Created Device %p\n", This, object); TRACE("(%p) : Created Device %p\n", This, object);
localParameters.BackBufferWidth = pPresentationParameters->BackBufferWidth; if (BehaviourFlags & D3DCREATE_ADAPTERGROUP_DEVICE)
localParameters.BackBufferHeight = pPresentationParameters->BackBufferHeight; {
localParameters.BackBufferFormat = wined3dformat_from_d3dformat(pPresentationParameters->BackBufferFormat); WINED3DCAPS caps;
localParameters.BackBufferCount = pPresentationParameters->BackBufferCount;
localParameters.MultiSampleType = pPresentationParameters->MultiSampleType; IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, &caps);
localParameters.MultiSampleQuality = pPresentationParameters->MultiSampleQuality; count = caps.NumberOfAdaptersInGroup;
localParameters.SwapEffect = pPresentationParameters->SwapEffect; }
localParameters.hDeviceWindow = pPresentationParameters->hDeviceWindow;
localParameters.Windowed = pPresentationParameters->Windowed;
localParameters.EnableAutoDepthStencil = pPresentationParameters->EnableAutoDepthStencil;
localParameters.AutoDepthStencilFormat = wined3dformat_from_d3dformat(pPresentationParameters->AutoDepthStencilFormat);
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
if(BehaviourFlags & D3DCREATE_MULTITHREADED) { if(BehaviourFlags & D3DCREATE_MULTITHREADED) {
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
} }
hr = IWineD3DDevice_Init3D(object->WineD3DDevice, &localParameters); localParameters = HeapAlloc(GetProcessHeap(), 0, sizeof(*localParameters) * count);
for (i = 0; i < count; ++i)
pPresentationParameters->BackBufferWidth = localParameters.BackBufferWidth; {
pPresentationParameters->BackBufferHeight = localParameters.BackBufferHeight; localParameters[i].BackBufferWidth = pPresentationParameters[i].BackBufferWidth;
pPresentationParameters->BackBufferFormat = d3dformat_from_wined3dformat(localParameters.BackBufferFormat); localParameters[i].BackBufferHeight = pPresentationParameters[i].BackBufferHeight;
pPresentationParameters->BackBufferCount = localParameters.BackBufferCount; localParameters[i].BackBufferFormat = wined3dformat_from_d3dformat(pPresentationParameters[i].BackBufferFormat);
pPresentationParameters->MultiSampleType = localParameters.MultiSampleType; localParameters[i].BackBufferCount = pPresentationParameters[i].BackBufferCount;
pPresentationParameters->MultiSampleQuality = localParameters.MultiSampleQuality; localParameters[i].MultiSampleType = pPresentationParameters[i].MultiSampleType;
pPresentationParameters->SwapEffect = localParameters.SwapEffect; localParameters[i].MultiSampleQuality = pPresentationParameters[i].MultiSampleQuality;
pPresentationParameters->hDeviceWindow = localParameters.hDeviceWindow; localParameters[i].SwapEffect = pPresentationParameters[i].SwapEffect;
pPresentationParameters->Windowed = localParameters.Windowed; localParameters[i].hDeviceWindow = pPresentationParameters[i].hDeviceWindow;
pPresentationParameters->EnableAutoDepthStencil = localParameters.EnableAutoDepthStencil; localParameters[i].Windowed = pPresentationParameters[i].Windowed;
pPresentationParameters->AutoDepthStencilFormat = d3dformat_from_wined3dformat(localParameters.AutoDepthStencilFormat); localParameters[i].EnableAutoDepthStencil = pPresentationParameters[i].EnableAutoDepthStencil;
pPresentationParameters->Flags = localParameters.Flags; localParameters[i].AutoDepthStencilFormat = wined3dformat_from_d3dformat(pPresentationParameters[i].AutoDepthStencilFormat);
pPresentationParameters->FullScreen_RefreshRateInHz = localParameters.FullScreen_RefreshRateInHz; localParameters[i].Flags = pPresentationParameters[i].Flags;
pPresentationParameters->PresentationInterval = localParameters.PresentationInterval; localParameters[i].FullScreen_RefreshRateInHz = pPresentationParameters[i].FullScreen_RefreshRateInHz;
localParameters[i].PresentationInterval = pPresentationParameters[i].PresentationInterval;
localParameters[i].AutoRestoreDisplayMode = TRUE;
}
hr = IWineD3DDevice_Init3D(object->WineD3DDevice, localParameters);
if (hr != D3D_OK) { if (hr != D3D_OK) {
FIXME("(%p) D3D Initialization failed for WineD3DDevice %p\n", This, object->WineD3DDevice); FIXME("(%p) D3D Initialization failed for WineD3DDevice %p\n", This, object->WineD3DDevice);
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
*ppReturnedDeviceInterface = NULL; *ppReturnedDeviceInterface = NULL;
} }
for (i = 0; i < count; ++i)
{
pPresentationParameters[i].BackBufferWidth = localParameters[i].BackBufferWidth;
pPresentationParameters[i].BackBufferHeight = localParameters[i].BackBufferHeight;
pPresentationParameters[i].BackBufferFormat = d3dformat_from_wined3dformat(localParameters[i].BackBufferFormat);
pPresentationParameters[i].BackBufferCount = localParameters[i].BackBufferCount;
pPresentationParameters[i].MultiSampleType = localParameters[i].MultiSampleType;
pPresentationParameters[i].MultiSampleQuality = localParameters[i].MultiSampleQuality;
pPresentationParameters[i].SwapEffect = localParameters[i].SwapEffect;
pPresentationParameters[i].hDeviceWindow = localParameters[i].hDeviceWindow;
pPresentationParameters[i].Windowed = localParameters[i].Windowed;
pPresentationParameters[i].EnableAutoDepthStencil = localParameters[i].EnableAutoDepthStencil;
pPresentationParameters[i].AutoDepthStencilFormat = d3dformat_from_wined3dformat(localParameters[i].AutoDepthStencilFormat);
pPresentationParameters[i].Flags = localParameters[i].Flags;
pPresentationParameters[i].FullScreen_RefreshRateInHz = localParameters[i].FullScreen_RefreshRateInHz;
pPresentationParameters[i].PresentationInterval = localParameters[i].PresentationInterval;
}
HeapFree(GetProcessHeap(), 0, localParameters);
/* Initialize the converted declaration array. This creates a valid pointer and when adding decls HeapReAlloc /* Initialize the converted declaration array. This creates a valid pointer and when adding decls HeapReAlloc
* can be used without further checking * can be used without further checking
*/ */
......
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