From 5903c5df1b1a365e2342678a900ee8ec6f83b5e2 Mon Sep 17 00:00:00 2001 From: Oliver Stieber Date: Mon, 28 Nov 2005 10:59:41 +0100 Subject: [PATCH] Stop reporting not having swapchain 0 as an error and add an internal variable instead of modifying a parameter. --- dlls/wined3d/device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5ce1df73b3c..fc0473b5247 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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);