=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Get rid of incorrect usage of "tex_unit_map".

Alexandre Julliard julliard at winehq.org
Mon Mar 13 15:40:32 CDT 2017


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Mar 13 11:57:20 2017 +0100

wined3d: Get rid of incorrect usage of "tex_unit_map".

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/state.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index b73f4a8..51257f0 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3489,7 +3489,9 @@ static void sampler_texmatrix(struct wined3d_context *context, const struct wine
 
     TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
 
-    if(!texture) return;
+    if (!texture)
+        return;
+
     /* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
      * wined3d_texture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
      * scaling is reapplied or removed, the texture matrix has to be reapplied
@@ -3499,17 +3501,16 @@ static void sampler_texmatrix(struct wined3d_context *context, const struct wine
      */
     if (sampler < MAX_TEXTURES)
     {
-        const BOOL texIsPow2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT);
+        const BOOL tex_is_pow2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT);
 
-        if (texIsPow2 || (context->lastWasPow2Texture & (1u << sampler)))
+        if (tex_is_pow2 || (context->lastWasPow2Texture & (1u << sampler)))
         {
-            if (texIsPow2)
+            if (tex_is_pow2)
                 context->lastWasPow2Texture |= 1u << sampler;
             else
                 context->lastWasPow2Texture &= ~(1u << sampler);
 
-            transform_texture(context, state,
-                    STATE_TEXTURESTAGE(context->tex_unit_map[sampler], WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS));
+            transform_texture(context, state, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS));
         }
     }
 }




More information about the wine-cvs mailing list