Commit 5903c5df authored by Oliver Stieber's avatar Oliver Stieber Committed by Alexandre Julliard

Stop reporting not having swapchain 0 as an error and add an internal

variable instead of modifying a parameter.
parent c622cd7c
......@@ -1560,21 +1560,22 @@ UINT WINAPI IWineD3DDeviceImpl_GetNumberOfSwapChains(IWineD3DDevice *iface)
HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface, UINT iSwapChain, IWineD3DSwapChain **pSwapChain) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
SwapChainList *swapchain;
int i = iSwapChain;
HRESULT hr = D3DERR_INVALIDCALL;
swapchain = This->swapchains;
TRACE("(%p) : swapchain %d\n", This, iSwapChain);
TRACE("(%p) Finding swapchain %d\n", This, iSwapChain);
while (iSwapChain > 0 && swapchain != NULL) {
while (i > 0 && swapchain != NULL) {
swapchain = swapchain->next;
iSwapChain--;
--i;
}
if (iSwapChain > 0 || swapchain == NULL) {
if (i > 0) {
FIXME("(%p) Unable to find swapchain %d\n", This, iSwapChain);
*pSwapChain = NULL;
} else {
} else if (swapchain != NULL) {
/** TODO: move off to a linkesList implementation **/
*pSwapChain = swapchain->swapchain;
IWineD3DSwapChain_AddRef(*pSwapChain);
......
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