Fwd: [wined3d] cube texture tidyup. resent

Oliver Stieber oliver_stieber at yahoo.co.uk
Thu Jul 14 08:33:43 CDT 2005


Please ignore this patch, os-1 has just been applied.

--- Oliver Stieber <oliver_stieber at yahoo.co.uk> wrote:

> with the patch this time..
> 
> --- Oliver Stieber <oliver_stieber at yahoo.co.uk>
> wrote:
> 
> > Date: Thu, 14 Jul 2005 14:11:57 +0100 (BST)
> > From: Oliver Stieber <oliver_stieber at yahoo.co.uk>
> > Subject: [wined3d] cube texture tidyup. resent
> > To: wine patch <wine-patches at winehq.org>
> > 
> > Hi,
> >    I've remerged this patch against wine-cvs.
> > 
> > Fix a bug in Preload caused be a missing brace
> > around a for loop,
> > 
> > improve the way that errors are handled by
> > passing back hr from some function calls.
> > Turn some fixme's into warns
> > remove superfluous IWineD3DSurface * casts
> > and remove circular referencing to parent.
> > 
> > The bug fix is the only notable functional change
> in
> > this patch.
> > 
> > 
> > 	
> > 	
> > 		
> >
>
___________________________________________________________
> > 
> > Yahoo! Messenger - NEW crystal clear PC to PC
> > calling worldwide with voicemail
> > http://uk.messenger.yahoo.com
> > 
> 
> 
> 	
> 	
> 		
>
___________________________________________________________
> 
> Yahoo! Messenger - NEW crystal clear PC to PC
> calling worldwide with voicemail
http://uk.messenger.yahoo.com> diff -X ignore -Nru
> clean/wine/dlls/wined3d/cubetexture.c
> small-patches/wine/dlls/wined3d/cubetexture.c
> --- clean/wine/dlls/wined3d/cubetexture.c	2005-07-14
> 13:33:26.586603584 +0100
> +++ small-patches/wine/dlls/wined3d/cubetexture.c
> 2005-07-14 13:46:39.080126256 +0100
> @@ -65,7 +65,6 @@
>  ULONG WINAPI
> IWineD3DCubeTextureImpl_AddRef(IWineD3DCubeTexture
> *iface) {
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>      TRACE("(%p) : AddRef increasing from %ld\n",
> This, This->resource.ref);
> -    IUnknown_AddRef(This->resource.parent);
>      return
> InterlockedIncrement(&This->resource.ref);
>  }
>  
> @@ -94,8 +93,6 @@
>          }
>         
> IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture
> *) iface);
>          HeapFree(GetProcessHeap(), 0, This);
> -    } else {
> -        IUnknown_Release(This->resource.parent); 
> /* Released the reference to the d3dx object */
>      }
>      return ref;
>  }
> @@ -143,10 +140,11 @@
>      /* If were dirty then reload the surfaces */
>      if (This->baseTexture.dirty != FALSE) {
>          for (i = 0; i < This->baseTexture.levels;
> i++) {
> -          for (j = 0; j < 6; j++)
> -              if(setGlTextureDesc)
> -                 
>
IWineD3DSurface_SetGlTextureDesc(This->surfaces[j][i],
> This->baseTexture.textureName, cube_targets[j]);
> -                 
> IWineD3DSurface_LoadTexture((IWineD3DSurface *)
> This->surfaces[j][i]);
> +            for (j = 0; j < 6; j++) {
> +                if(setGlTextureDesc)
> +                   
>
IWineD3DSurface_SetGlTextureDesc(This->surfaces[j][i],
> This->baseTexture.textureName, cube_targets[j]);
> +               
> IWineD3DSurface_LoadTexture(This->surfaces[j][i]);
> +            }
>          }
>          /* No longer dirty */
>          This->baseTexture.dirty = FALSE;
> @@ -216,60 +214,74 @@
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>      TRACE("(%p) \n", This);
>  
> -    return GLTEXTURECUBEMAP;
> +    return GL_TEXTURE_CUBE_MAP_ARB;
>  }
>  
>  /* *******************************************
>     IWineD3DCubeTexture IWineD3DCubeTexture parts
> follow
>     ******************************************* */
>  HRESULT WINAPI
>
IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture
> *iface, UINT Level, WINED3DSURFACE_DESC* pDesc) {
> +    HRESULT hr = D3DERR_INVALIDCALL;
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>  
>      if (Level < This->baseTexture.levels) {
> -        TRACE("(%p) level (%d)\n", This, Level);
> -        return
> IWineD3DSurface_GetDesc((IWineD3DSurface *)
> This->surfaces[0][Level], pDesc);
> +
> +        hr =
> IWineD3DSurface_GetDesc(This->surfaces[0][Level],
> pDesc);
>      }
> -    FIXME("(%p) level(%d) overflow Levels(%d)\n",
> This, Level, This->baseTexture.levels);
> -    return D3DERR_INVALIDCALL;
> +
> +    if (D3D_OK == hr) {
> +        TRACE("(%p) level (%d) returning
> desc@%p\n", This, Level, pDesc);
> +    } else {
> +        WARN("(%p) level(%d) overflow
> Levels(%d)\n", This, Level,
> This->baseTexture.levels);
> +    }
> +    return hr;
>  }
>  
>  HRESULT WINAPI
>
IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeTexture
> *iface, D3DCUBEMAP_FACES FaceType, UINT Level,
> IWineD3DSurface** ppCubeMapSurface) {
> +    HRESULT hr = D3DERR_INVALIDCALL;
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>      if (Level < This->baseTexture.levels) {
> -        *ppCubeMapSurface = (IWineD3DSurface *)
> This->surfaces[FaceType][Level];
> -        IWineD3DSurface_AddRef((IWineD3DSurface *)
> *ppCubeMapSurface);
> +        *ppCubeMapSurface =
> This->surfaces[FaceType][Level];
> +        IWineD3DSurface_AddRef(*ppCubeMapSurface);
> +        hr = D3D_OK;
> +    }
> +
> +    if (D3D_OK == hr) {
>          TRACE("(%p) -> faceType(%d) level(%d)
> returning surface@%p \n", This, FaceType, Level,
> This->surfaces[FaceType][Level]);
>      } else {
> -        FIXME("(%p) level(%d) overflow
> Levels(%d)\n", This, Level,
> This->baseTexture.levels);
> -        return D3DERR_INVALIDCALL;
> +        WARN("(%p) level(%d) overflow
> Levels(%d)\n", This, Level,
> This->baseTexture.levels);
>      }
> -    return D3D_OK;
> +    return hr;
>  }
>  
>  HRESULT WINAPI
> IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture
> *iface, D3DCUBEMAP_FACES FaceType, UINT Level,
> D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,
> DWORD Flags) {
> -    HRESULT hr;
> +    HRESULT hr = D3DERR_INVALIDCALL;
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>  
>      if (Level < This->baseTexture.levels) {
> -      hr =
> IWineD3DSurface_LockRect((IWineD3DSurface *)
> This->surfaces[FaceType][Level], pLockedRect, pRect,
> Flags);
> -      TRACE("(%p) -> faceType(%d) level(%d)
> returning memory@%p success(%lu)\n", This, FaceType,
> Level, pLockedRect->pBits, hr);
> +        hr =
>
IWineD3DSurface_LockRect(This->surfaces[FaceType][Level],
> pLockedRect, pRect, Flags);
> +    }
> +
> +    if (D3D_OK == hr) {
> +        TRACE("(%p) -> faceType(%d) level(%d)
> returning memory@%p success(%lu)\n", This, FaceType,
> Level,   pLockedRect->pBits, hr);
>      } else {
> -      FIXME("(%p) level(%d) overflow Levels(%d)\n",
> This, Level, This->baseTexture.levels);
> -      return D3DERR_INVALIDCALL;
> +        WARN("(%p) level(%d) overflow
> Levels(%d)\n", This, Level,
> This->baseTexture.levels);
>      }
>      return hr;
>  }
>  
>  HRESULT WINAPI
>
IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture
> *iface, D3DCUBEMAP_FACES FaceType, UINT Level) {
> -    HRESULT hr;
> +    HRESULT hr = D3DERR_INVALIDCALL;
>      IWineD3DCubeTextureImpl *This =
> (IWineD3DCubeTextureImpl *)iface;
>  
>      if (Level < This->baseTexture.levels) {
> -      hr =
> IWineD3DSurface_UnlockRect((IWineD3DSurface *)
> This->surfaces[FaceType][Level]);
> -      TRACE("(%p) -> faceType(%d) level(%d)
> success(%lu)\n", This, FaceType, Level, hr);
> +      hr =
>
IWineD3DSurface_UnlockRect(This->surfaces[FaceType][Level]);
> +    }
> +
> +    if (D3D_OK == hr) {
> +        TRACE("(%p) -> faceType(%d) level(%d)
> success(%lu)\n", This, FaceType, Level, hr);
>      } else {
> -      FIXME("(%p) level(%d) overflow Levels(%d)\n",
> This, Level, This->baseTexture.levels);
> -      return D3DERR_INVALIDCALL;
> +        WARN("(%p) level(%d) overflow
> Levels(%d)\n", This, Level,
> This->baseTexture.levels);
> 
=== message truncated ===



		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com



More information about the wine-patches mailing list