Henri Verbeet : wined3d: Simplify a condition in IWineD3DSurfaceImpl_LoadTexture().

Alexandre Julliard julliard at winehq.org
Fri Nov 12 11:22:37 CST 2010


Module: wine
Branch: master
Commit: a59ee29dec293b9dcc3306bf40b3587c4228d8b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a59ee29dec293b9dcc3306bf40b3587c4228d8b0

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Nov 12 13:12:03 2010 +0100

wined3d: Simplify a condition in IWineD3DSurfaceImpl_LoadTexture().

---

 dlls/wined3d/surface.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8d848d2..618e3f0 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2443,14 +2443,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, BO
 
     if (!(This->Flags & flag)) {
         TRACE("Reloading because surface is dirty\n");
-    } else if(/* Reload: gl texture has ck, now no ckey is set OR */
-              ((This->Flags & SFLAG_GLCKEY) && (!(This->CKeyFlags & WINEDDSD_CKSRCBLT))) ||
-              /* Reload: vice versa  OR */
-              ((!(This->Flags & SFLAG_GLCKEY)) && (This->CKeyFlags & WINEDDSD_CKSRCBLT)) ||
-              /* Also reload: Color key is active AND the color key has changed */
-              ((This->CKeyFlags & WINEDDSD_CKSRCBLT) && (
-                (This->glCKey.dwColorSpaceLowValue != This->SrcBltCKey.dwColorSpaceLowValue) ||
-                (This->glCKey.dwColorSpaceHighValue != This->SrcBltCKey.dwColorSpaceHighValue)))) {
+    }
+    /* Reload if either the texture and sysmem have different ideas about the
+     * color key, or the actual key values changed. */
+    else if (!(This->Flags & SFLAG_GLCKEY) != !(This->CKeyFlags & WINEDDSD_CKSRCBLT)
+            || ((This->CKeyFlags & WINEDDSD_CKSRCBLT)
+            && (This->glCKey.dwColorSpaceLowValue != This->SrcBltCKey.dwColorSpaceLowValue
+            || This->glCKey.dwColorSpaceHighValue != This->SrcBltCKey.dwColorSpaceHighValue)))
+    {
         TRACE("Reloading because of color keying\n");
         /* To perform the color key conversion we need a sysmem copy of
          * the surface. Make sure we have it




More information about the wine-cvs mailing list