Stefan Dösinger : wined3d: Honor the texcoordindex when setting the texture matrix.

Alexandre Julliard julliard at winehq.org
Thu Jul 24 07:06:55 CDT 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Jul 22 13:56:07 2008 -0500

wined3d: Honor the texcoordindex when setting the texture matrix.

---

 dlls/wined3d/state.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 9e29d78..a6903c6 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3108,6 +3108,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W
     DWORD texUnit = state - STATE_TRANSFORM(WINED3DTS_TEXTURE0);
     DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[texUnit];
     BOOL generated;
+    int coordIdx;
 
     /* Ignore this when a vertex shader is used, or if the streams aren't sorted out yet */
     if(use_vs(stateblock->wineD3DDevice) ||
@@ -3130,13 +3131,14 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W
         return;
     }
     generated = (stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU;
+    coordIdx = min(stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX & 0x0000FFFF], MAX_TEXTURES - 1);
 
     set_texture_matrix(&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0],
                         stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS],
                         generated,
                         context->last_was_rhw,
-                        stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwStride ?
-                            stateblock->wineD3DDevice->strided_streams.u.s.texCoords[texUnit].dwType:
+                        stateblock->wineD3DDevice->strided_streams.u.s.texCoords[coordIdx].dwStride ?
+                            stateblock->wineD3DDevice->strided_streams.u.s.texCoords[coordIdx].dwType:
                             WINED3DDECLTYPE_UNUSED);
 
     /* The sampler applying function calls us if this changes */




More information about the wine-cvs mailing list