From 837027fcb74c4a0afaadcd242dade09c11530390 Mon Sep 17 00:00:00 2001 From: Ivan Gyurdiev Date: Tue, 10 Oct 2006 21:52:50 -0400 Subject: [PATCH] wined3d: D3DTEXTURESTAGESTATETYPE: Consistently use in WINED3D namespace. --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/device.c | 2 +- dlls/wined3d/drawprim.c | 24 ++++++++++----------- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/stateblock.c | 36 +++++++++++++++---------------- dlls/wined3d/utils.c | 16 +++++++------- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index bf838d6eea2..fece94146b0 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -673,7 +673,7 @@ void pshader_hw_tex(SHADER_OPCODE_ARG* arg) { tex_type = "2D"; } - if (deviceImpl->stateBlock->textureState[reg_sampler_code][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { + if (deviceImpl->stateBlock->textureState[reg_sampler_code][WINED3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { shader_addline(buffer, "TXP %s, %s, texture[%u], %s;\n", reg_dest, reg_coord, reg_sampler_code, tex_type); } else { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 268cb55ce06..86a48f48542 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5528,7 +5528,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, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION | 1 ); + eg. SetTextureStageState( 0, WINED3DTSS_TEXCOORDINDEX, D3DTSS_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 D3DRENDERSTATE_WRAPx values, nor tie them up diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 9511b8cb2a7..8e5f8682ed3 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -570,7 +570,7 @@ void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDi /* numTextures indicates the number of texture coordinates supplied */ /* However, the first set may not be for stage 0 texture - it all */ - /* depends on D3DTSS_TEXCOORDINDEX. */ + /* depends on WINED3DTSS_TEXCOORDINDEX. */ /* The number of bytes for each coordinate set is based off */ /* D3DFVF_TEXCOORDSIZEn, which are the bottom 2 bits */ @@ -715,7 +715,7 @@ static void draw_vertex(IWineD3DDevice *iface, /* interf /* Query tex coords */ if (This->stateBlock->textures[textureNo] != NULL) { - int coordIdx = This->stateBlock->textureState[textureNo][D3DTSS_TEXCOORDINDEX]; + int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; if (coordIdx >= MAX_TEXTURES) { VTRACE(("tex: %d - Skip tex coords, as being system generated\n", textureNo)); continue; @@ -1179,7 +1179,7 @@ static void loadVertexData(IWineD3DDevice *iface, WineDirect3DVertexStridedData } if (This->stateBlock->textures[textureNo] != NULL) { - int coordIdx = This->stateBlock->textureState[textureNo][D3DTSS_TEXCOORDINDEX]; + int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; if (coordIdx >= MAX_TEXTURES) { VTRACE(("tex: %d - Skip tex coords, as being system generated\n", textureNo)); @@ -1387,7 +1387,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData /* Query tex coords */ if (This->stateBlock->textures[textureNo] != NULL) { - int coordIdx = This->stateBlock->textureState[textureNo][D3DTSS_TEXCOORDINDEX]; + int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; float *ptrToCoords = NULL; float s = 0.0, t = 0.0, r = 0.0, q = 0.0; @@ -1419,11 +1419,11 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData } /* Projected is more 'fun' - Move the last coord to the 'q' - parameter (see comments under D3DTSS_TEXTURETRANSFORMFLAGS */ - if ((This->stateBlock->textureState[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] != D3DTTFF_DISABLE) && - (This->stateBlock->textureState[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED)) { + parameter (see comments under WINED3DTSS_TEXTURETRANSFORMFLAGS */ + if ((This->stateBlock->textureState[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] != D3DTTFF_DISABLE) && + (This->stateBlock->textureState[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED)) { - if (This->stateBlock->textureState[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { + if (This->stateBlock->textureState[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { switch (coordsToUse) { case 0: /* Drop Through */ case 1: @@ -1442,8 +1442,8 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData case 4: /* Nop here */ break; default: - FIXME("Unexpected D3DTSS_TEXTURETRANSFORMFLAGS value of %d\n", - This->stateBlock->textureState[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED); + FIXME("Unexpected WINED3DTSS_TEXTURETRANSFORMFLAGS value of %d\n", + This->stateBlock->textureState[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED); } } } @@ -1683,8 +1683,8 @@ void drawStridedSoftwareVS(IWineD3DDevice *iface, WineDirect3DVertexStridedData texcoords[textureNo].y = vertexShader->output.oT[textureNo].y; texcoords[textureNo].z = vertexShader->output.oT[textureNo].z; texcoords[textureNo].w = vertexShader->output.oT[textureNo].w; - if (This->stateBlock->texture_state[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] != D3DTTFF_DISABLE) { - numcoords[textureNo] = This->stateBlock->texture_state[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] & ~D3DTTFF_PROJECTED; + if (This->stateBlock->texture_state[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] != D3DTTFF_DISABLE) { + numcoords[textureNo] = This->stateBlock->texture_state[textureNo][WINED3DTSS_TEXTURETRANSFORMFLAGS] & ~D3DTTFF_PROJECTED; } else { switch (IDirect3DBaseTexture8Impl_GetType((LPDIRECT3DBASETEXTURE8) This->stateBlock->textures[textureNo])) { case WINED3DRTYPE_TEXTURE: numcoords[textureNo] = 2; break; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 9ced8be6a24..3637c9fb55b 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1393,7 +1393,7 @@ void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) { } sampler_type = arg->reg_maps->samplers[sampler_code] & WINED3DSP_TEXTURETYPE_MASK; - if(deviceImpl->stateBlock->textureState[sampler_code][D3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { + if(deviceImpl->stateBlock->textureState[sampler_code][WINED3DTSS_TEXTURETRANSFORMFLAGS] & D3DTTFF_PROJECTED) { switch(sampler_type) { case WINED3DSTT_2D: diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 98de6929afd..3356a71ca81 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -985,24 +985,24 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat for (i = 0; i < GL_LIMITS(texture_stages); i++) { TRACE("Setting up default texture states for texture Stage %d\n", i); memcpy(&This->transforms[WINED3DTS_TEXTURE0 + i], &identity, sizeof(identity)); - This->textureState[i][D3DTSS_COLOROP ] = (i==0)? D3DTOP_MODULATE : D3DTOP_DISABLE; - This->textureState[i][D3DTSS_COLORARG1 ] = D3DTA_TEXTURE; - This->textureState[i][D3DTSS_COLORARG2 ] = D3DTA_CURRENT; - This->textureState[i][D3DTSS_ALPHAOP ] = (i==0)? D3DTOP_SELECTARG1 : D3DTOP_DISABLE; - This->textureState[i][D3DTSS_ALPHAARG1 ] = D3DTA_TEXTURE; - This->textureState[i][D3DTSS_ALPHAARG2 ] = D3DTA_CURRENT; - This->textureState[i][D3DTSS_BUMPENVMAT00 ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_BUMPENVMAT01 ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_BUMPENVMAT10 ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_BUMPENVMAT11 ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_TEXCOORDINDEX ] = i; - This->textureState[i][D3DTSS_BUMPENVLSCALE ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_BUMPENVLOFFSET ] = (DWORD) 0.0; - This->textureState[i][D3DTSS_TEXTURETRANSFORMFLAGS ] = D3DTTFF_DISABLE; - This->textureState[i][D3DTSS_ADDRESSW ] = D3DTADDRESS_WRAP; - This->textureState[i][D3DTSS_COLORARG0 ] = D3DTA_CURRENT; - This->textureState[i][D3DTSS_ALPHAARG0 ] = D3DTA_CURRENT; - This->textureState[i][D3DTSS_RESULTARG ] = D3DTA_CURRENT; + This->textureState[i][WINED3DTSS_COLOROP ] = (i==0)? D3DTOP_MODULATE : D3DTOP_DISABLE; + This->textureState[i][WINED3DTSS_COLORARG1 ] = D3DTA_TEXTURE; + This->textureState[i][WINED3DTSS_COLORARG2 ] = D3DTA_CURRENT; + This->textureState[i][WINED3DTSS_ALPHAOP ] = (i==0)? D3DTOP_SELECTARG1 : D3DTOP_DISABLE; + This->textureState[i][WINED3DTSS_ALPHAARG1 ] = D3DTA_TEXTURE; + This->textureState[i][WINED3DTSS_ALPHAARG2 ] = D3DTA_CURRENT; + This->textureState[i][WINED3DTSS_BUMPENVMAT00 ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVMAT01 ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVMAT10 ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVMAT11 ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_TEXCOORDINDEX ] = i; + This->textureState[i][WINED3DTSS_BUMPENVLSCALE ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_BUMPENVLOFFSET ] = (DWORD) 0.0; + This->textureState[i][WINED3DTSS_TEXTURETRANSFORMFLAGS ] = D3DTTFF_DISABLE; + This->textureState[i][WINED3DTSS_ADDRESSW ] = D3DTADDRESS_WRAP; + This->textureState[i][WINED3DTSS_COLORARG0 ] = D3DTA_CURRENT; + This->textureState[i][WINED3DTSS_ALPHAARG0 ] = D3DTA_CURRENT; + This->textureState[i][WINED3DTSS_RESULTARG ] = D3DTA_CURRENT; } /* Sampler states*/ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b8c6b5d4971..12fbbb2e00d 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -563,7 +563,7 @@ const char* debug_d3dtexturestate(DWORD state) { D3DSTATE_TO_STR(WINED3DTSS_CONSTANT ); #undef D3DSTATE_TO_STR case 12: - /* Note D3DTSS are not consecutive, so skip these */ + /* Note WINED3DTSS are not consecutive, so skip these */ return "unused"; break; default: @@ -701,12 +701,12 @@ static GLenum d3dta_to_combiner_input(DWORD d3dta, DWORD stage, INT texture_idx) return GL_SECONDARY_COLOR_NV; case D3DTA_TEMP: - /* TODO: Support D3DTSS_RESULTARG */ + /* TODO: Support WINED3DTSS_RESULTARG */ FIXME("D3DTA_TEMP, not properly supported.\n"); return GL_SPARE1_NV; case D3DTA_CONSTANT: - /* TODO: Support per stage constants (D3DTSS_CONSTANT, NV_register_combiners2) */ + /* TODO: Support per stage constants (WINED3DTSS_CONSTANT, NV_register_combiners2) */ FIXME("D3DTA_CONSTANT, not properly supported.\n"); return GL_CONSTANT_COLOR1_NV; @@ -784,7 +784,7 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTURE { case D3DTOP_DISABLE: /* Only for alpha */ - if (!is_alpha) ERR("Shouldn't be called for D3DTSS_COLOROP (D3DTOP_DISABLE)\n"); + if (!is_alpha) ERR("Shouldn't be called for WINED3DTSS_COLOROP (D3DTOP_DISABLE)\n"); /* Input, prev_alpha*1 */ GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA)); @@ -932,7 +932,7 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTURE case D3DTOP_MODULATEALPHA_ADDCOLOR: /* Input, arg1_alpha*arg2_rgb+arg1_rgb*1 */ - if (is_alpha) ERR("Only supported for D3DTSS_COLOROP (D3DTOP_MODULATEALPHA_ADDCOLOR)\n"); + if (is_alpha) ERR("Only supported for WINED3DTSS_COLOROP (D3DTOP_MODULATEALPHA_ADDCOLOR)\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, @@ -949,7 +949,7 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTURE case D3DTOP_MODULATECOLOR_ADDALPHA: /* Input, arg1_rgb*arg2_rgb+arg1_alpha*1 */ - if (is_alpha) ERR("Only supported for D3DTSS_COLOROP (D3DTOP_MODULATECOLOR_ADDALPHA)\n"); + if (is_alpha) ERR("Only supported for WINED3DTSS_COLOROP (D3DTOP_MODULATECOLOR_ADDALPHA)\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, @@ -966,7 +966,7 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTURE case D3DTOP_MODULATEINVALPHA_ADDCOLOR: /* Input, (1-arg1_alpha)*arg2_rgb+arg1_rgb*1 */ - if (is_alpha) ERR("Only supported for D3DTSS_COLOROP (D3DTOP_MODULATEINVALPHA_ADDCOLOR)\n"); + if (is_alpha) ERR("Only supported for WINED3DTSS_COLOROP (D3DTOP_MODULATEINVALPHA_ADDCOLOR)\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), GL_ALPHA)); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV, @@ -983,7 +983,7 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTURE case D3DTOP_MODULATEINVCOLOR_ADDALPHA: /* Input, (1-arg1_rgb)*arg2_rgb+arg1_alpha*1 */ - if (is_alpha) ERR("Only supported for D3DTSS_COLOROP (D3DTOP_MODULATEINVCOLOR_ADDALPHA)\n"); + if (is_alpha) ERR("Only supported for WINED3DTSS_COLOROP (D3DTOP_MODULATEINVCOLOR_ADDALPHA)\n"); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV, tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), tex_op_args.component_usage[0])); GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,