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

wined3d: Add D3DTEXTUREOP to the WINED3D namespace.

parent 75c67f6b
......@@ -2254,8 +2254,8 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLORARG2, D3DTA_CURRENT);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, D3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, WINED3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, WINED3DTOP_SELECTARG1);
break;
case D3DTBLEND_MODULATEALPHA:
......@@ -2263,23 +2263,23 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLORARG2, D3DTA_CURRENT);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, D3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, WINED3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, WINED3DTOP_MODULATE);
break;
case D3DTBLEND_DECAL:
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, WINED3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, WINED3DTOP_SELECTARG1);
break;
case D3DTBLEND_DECALALPHA:
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_COLOROP, WINED3DTOP_SELECTARG1);
IWineD3DDevice_SetTextureStageState(iface, 0, D3DTSS_ALPHAOP, WINED3DTOP_MODULATE);
break;
default:
......
......@@ -1972,8 +1972,8 @@ static void drawPrimitiveUploadTextures(IWineD3DDeviceImpl* This) {
for (i = 0; i < GL_LIMITS(texture_stages); ++i) {
INT texture_idx = -1;
/* D3DTOP_DISABLE disables the current & any higher texture stages */
if (This->stateBlock->textureState[i][WINED3DTSS_COLOROP] == D3DTOP_DISABLE) break;
/* WINED3DTOP_DISABLE disables the current & any higher texture stages */
if (This->stateBlock->textureState[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE) break;
if (!GL_SUPPORT(NV_REGISTER_COMBINERS) || This->stateBlock->textures[i]) {
texture_idx = current_sampler++;
......@@ -2057,7 +2057,7 @@ static void drawPrimitiveUploadTextures(IWineD3DDeviceImpl* This) {
/* If we're using register combiners, set the amount of *used* combiners.
* Ie, the number of stages below the first stage to have a color op of
* D3DTOP_DISABLE. */
* WINED3DTOP_DISABLE. */
if (GL_SUPPORT(NV_REGISTER_COMBINERS)) {
/* NUM_GENERAL_COMBINERS_NV should be > 0 */
if (!i) glDisable(GL_REGISTER_COMBINERS_NV);
......
......@@ -985,10 +985,10 @@ 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][WINED3DTSS_COLOROP ] = (i==0)? D3DTOP_MODULATE : D3DTOP_DISABLE;
This->textureState[i][WINED3DTSS_COLOROP ] = (i==0)? WINED3DTOP_MODULATE : WINED3DTOP_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_ALPHAOP ] = (i==0)? WINED3DTOP_SELECTARG1 : WINED3DTOP_DISABLE;
This->textureState[i][WINED3DTSS_ALPHAARG1 ] = D3DTA_TEXTURE;
This->textureState[i][WINED3DTSS_ALPHAARG2 ] = D3DTA_CURRENT;
This->textureState[i][WINED3DTSS_BUMPENVMAT00 ] = (DWORD) 0.0;
......
......@@ -1262,8 +1262,8 @@ const char* debug_d3dpool(WINED3DPOOL pool);
/* Routines for GL <-> D3D values */
GLenum StencilOp(DWORD op);
GLenum CompareFunc(DWORD func);
void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx);
void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx);
void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords);
int D3DFmtMakeGlCfg(WINED3DFORMAT BackBufferFormat, WINED3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate);
......
......@@ -543,6 +543,37 @@ typedef enum _WINED3DTEXTURESTAGESTATETYPE {
#define WINED3D_HIGHEST_TEXTURE_STATE WINED3DTSS_CONSTANT
typedef enum _WINED3DTEXTUREOP {
WINED3DTOP_DISABLE = 1,
WINED3DTOP_SELECTARG1 = 2,
WINED3DTOP_SELECTARG2 = 3,
WINED3DTOP_MODULATE = 4,
WINED3DTOP_MODULATE2X = 5,
WINED3DTOP_MODULATE4X = 6,
WINED3DTOP_ADD = 7,
WINED3DTOP_ADDSIGNED = 8,
WINED3DTOP_ADDSIGNED2X = 9,
WINED3DTOP_SUBTRACT = 10,
WINED3DTOP_ADDSMOOTH = 11,
WINED3DTOP_BLENDDIFFUSEALPHA = 12,
WINED3DTOP_BLENDTEXTUREALPHA = 13,
WINED3DTOP_BLENDFACTORALPHA = 14,
WINED3DTOP_BLENDTEXTUREALPHAPM = 15,
WINED3DTOP_BLENDCURRENTALPHA = 16,
WINED3DTOP_PREMODULATE = 17,
WINED3DTOP_MODULATEALPHA_ADDCOLOR = 18,
WINED3DTOP_MODULATECOLOR_ADDALPHA = 19,
WINED3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
WINED3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
WINED3DTOP_BUMPENVMAP = 22,
WINED3DTOP_BUMPENVMAPLUMINANCE = 23,
WINED3DTOP_DOTPRODUCT3 = 24,
WINED3DTOP_MULTIPLYADD = 25,
WINED3DTOP_LERP = 26,
WINED3DTOP_FORCE_DWORD = 0x7fffffff,
} WINED3DTEXTUREOP;
typedef enum _WINED3DTRANSFORMSTATETYPE {
WINED3DTS_VIEW = 2,
WINED3DTS_PROJECTION = 3,
......
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