dlls/wined3d/cubetexture.c
Gerald Pfeifer
gerald at pfeifer.com
Tue Jan 1 06:21:11 CST 2008
Hej Alexandre,
Gerald Pfeifer wrote:
> Indeed WINED3DTEXF_NONE is 0 and thus the comparison is a noop. I see
> three ways to handle this:
>
> 1. the straightforward patch below,
> 2. adding an #ifdef WINED3DTEXF_NONE > 0 around those two conditions,
> 3. living with the warning.
> [...]
> Thoughts?
since I saw you go for option 1 in the case of basetexture.c, here is
the analog patch for cubetexture.c. ;-)
Gerald
ChangeLog:
Remove four noop checks.
Index: dlls/wined3d/cubetexture.c
===================================================================
RCS file: /home/wine/wine/dlls/wined3d/cubetexture.c,v
retrieving revision 1.40
diff -u -3 -p -r1.40 cubetexture.c
--- dlls/wined3d/cubetexture.c 14 Nov 2007 13:35:20 -0000 1.40
+++ dlls/wined3d/cubetexture.c 1 Jan 2008 12:07:38 -0000
@@ -273,7 +273,7 @@ static HRESULT WINAPI IWineD3DCubeTextur
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
HRESULT hr = WINED3DERR_INVALIDCALL;
- if (Level < This->baseTexture.levels && FaceType >= WINED3DCUBEMAP_FACE_POSITIVE_X && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
+ if (Level < This->baseTexture.levels && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
*ppCubeMapSurface = This->surfaces[FaceType][Level];
IWineD3DSurface_AddRef(*ppCubeMapSurface);
@@ -292,7 +292,7 @@ static HRESULT WINAPI IWineD3DCubeTextur
HRESULT hr = WINED3DERR_INVALIDCALL;
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
- if (Level < This->baseTexture.levels && FaceType >= WINED3DCUBEMAP_FACE_POSITIVE_X && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
+ if (Level < This->baseTexture.levels && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
hr = IWineD3DSurface_LockRect(This->surfaces[FaceType][Level], pLockedRect, pRect, Flags);
}
@@ -309,7 +309,7 @@ static HRESULT WINAPI IWineD3DCubeTextur
HRESULT hr = WINED3DERR_INVALIDCALL;
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
- if (Level < This->baseTexture.levels && FaceType >= WINED3DCUBEMAP_FACE_POSITIVE_X && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
+ if (Level < This->baseTexture.levels && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
hr = IWineD3DSurface_UnlockRect(This->surfaces[FaceType][Level]);
}
@@ -326,7 +326,7 @@ static HRESULT WINAPI IWineD3DCubeTextu
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
This->baseTexture.dirty = TRUE;
TRACE("(%p) : dirtyfication of faceType(%d) Level (0)\n", This, FaceType);
- if (FaceType >= WINED3DCUBEMAP_FACE_POSITIVE_X && FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
+ if (FaceType <= WINED3DCUBEMAP_FACE_NEGATIVE_Z) {
hr = IWineD3DSurface_AddDirtyRect(This->surfaces[FaceType][0], pDirtyRect);
} else {
WARN("(%p) overflow FaceType(%d)\n", This, FaceType);
More information about the wine-patches
mailing list