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

variable instead of modifying a parameter.
This commit is contained in:
Oliver Stieber 2005-11-28 10:59:41 +01:00 committed by Alexandre Julliard
parent c622cd7c24
commit 5903c5df1b
1 changed files with 5 additions and 4 deletions

View File

@ -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);