Module: wine Branch: master Commit: de108f65e1f4e2afc0fc8eb5458f70cb2f2126ae URL: http://source.winehq.org/git/wine.git/?a=commit;h=de108f65e1f4e2afc0fc8eb545...
Author: Ivan Gyurdiev ivg231@gmail.com Date: Tue Oct 31 03:16:44 2006 -0500
wined3d: Add D3DTSS_TCI codes to the WINED3D namespace.
---
dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/device.c | 12 ++++++------ dlls/wined3d/texture.c | 2 +- include/wine/wined3d_types.h | 6 ++++++ 4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 688d5d9..6250975 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -232,7 +232,7 @@ static void WINAPI IWineD3DCubeTextureIm
/* Apply non-power2 mappings and texture offsets so long as the texture coords aren't projected or generated */ if(This->pow2scalingFactor != 1.0f) { - if((textureStates[WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) == D3DTSS_TCI_PASSTHRU && + if((textureStates[WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) == WINED3DTSS_TCI_PASSTHRU && (~textureStates[WINED3DTSS_TEXTURETRANSFORMFLAGS] & WINED3DTTFF_PROJECTED)) {
glMatrixMode(GL_TEXTURE); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a1aaff6..650c739 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5530,7 +5530,7 @@ #endif /* FIXME: From MSDN: The WINED3DTSS_TCI_* flags are mutually exclusive. If you include one flag, you can still specify an index value, which the system uses to determine the texture wrapping mode. - eg. SetTextureStageState( 0, WINED3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION | 1 ); + eg. SetTextureStageState( 0, WINED3DTSS_TEXCOORDINDEX, WINED3DTSS_TCI_CAMERASPACEPOSITION | 1 ); means use the vertex position (camera-space) as the input texture coordinates for this texture stage, and the wrap mode set in the WINED3DRS_WRAP1 render state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up @@ -5540,7 +5540,7 @@ #endif * Be careful the value of the mask 0xF0000 come from d3d8types.h infos */ switch (Value & 0xFFFF0000) { - case D3DTSS_TCI_PASSTHRU: + case WINED3DTSS_TCI_PASSTHRU: /*Use the specified texture coordinates contained within the vertex format. This value resolves to zero.*/ glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); @@ -5549,7 +5549,7 @@ #endif checkGLcall("glDisable(GL_TEXTURE_GEN_S,T,R,Q)"); break;
- case D3DTSS_TCI_CAMERASPACEPOSITION: + case WINED3DTSS_TCI_CAMERASPACEPOSITION: /* CameraSpacePosition means use the vertex position, transformed to camera space, as the input texture coordinates for this stage's texture transformation. This equates roughly to EYE_LINEAR */ @@ -5585,7 +5585,7 @@ #endif } break;
- case D3DTSS_TCI_CAMERASPACENORMAL: + case WINED3DTSS_TCI_CAMERASPACENORMAL: { if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) { float s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; @@ -5619,7 +5619,7 @@ #endif } break;
- case D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: + case WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: { if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) { float s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; @@ -5669,7 +5669,7 @@ #endif
/* Unhandled */ case WINED3DTSS_TEXTURETRANSFORMFLAGS : - set_texture_matrix((float *)&This->stateBlock->transforms[WINED3DTS_TEXTURE0 + Stage].u.m[0][0], Value, (This->stateBlock->textureState[Stage][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != D3DTSS_TCI_PASSTHRU); + set_texture_matrix((float *)&This->stateBlock->transforms[WINED3DTS_TEXTURE0 + Stage].u.m[0][0], Value, (This->stateBlock->textureState[Stage][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU); break;
case WINED3DTSS_BUMPENVMAT00 : diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 9217ad9..a1ce721 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -215,7 +215,7 @@ static void WINAPI IWineD3DTextureImpl_A /** non-power2 fixups using texture matrix **/ if(This->pow2scalingFactorX != 1.0f || This->pow2scalingFactorY != 1.0f) { /* Apply non-power2 mappings and texture offsets so long as the texture coords aren't projected or generated */ - if(((textureStates[WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) == D3DTSS_TCI_PASSTHRU) && + if(((textureStates[WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) == WINED3DTSS_TCI_PASSTHRU) && (~textureStates[WINED3DTSS_TEXTURETRANSFORMFLAGS] & WINED3DTTFF_PROJECTED)) { glMatrixMode(GL_TEXTURE); memset(matrix, 0 , sizeof(matrix)); diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index d1b15df..3715d2a 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -653,6 +653,12 @@ typedef enum _WINED3DTEXTURESTAGESTATETY WINED3DTSS_FORCE_DWORD = 0x7fffffff } WINED3DTEXTURESTAGESTATETYPE;
+#define WINED3DTSS_TCI_PASSTHRU 0x00000 +#define WINED3DTSS_TCI_CAMERASPACENORMAL 0x10000 +#define WINED3DTSS_TCI_CAMERASPACEPOSITION 0x20000 +#define WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x30000 +#define WINED3DTSS_TCI_SPHEREMAP 0x40000 + #define WINED3D_HIGHEST_TEXTURE_STATE WINED3DTSS_CONSTANT
typedef enum _WINED3DTEXTURETRANSFORMFLAGS {