Commit de108f65 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Add D3DTSS_TCI codes to the WINED3D namespace.

parent 875a1eb0
......@@ -232,7 +232,7 @@ static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture
/* 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);
......
......@@ -5530,7 +5530,7 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
/* 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 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
* 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 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
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 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
}
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 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
}
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 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
/* 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 :
......
......@@ -215,7 +215,7 @@ static void WINAPI IWineD3DTextureImpl_ApplyStateChanges(IWineD3DTexture *iface,
/** 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));
......
......@@ -653,6 +653,12 @@ typedef enum _WINED3DTEXTURESTAGESTATETYPE {
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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment