wined3d: Add D3DTADDRESS to the WINED3D namespace.

This commit is contained in:
Ivan Gyurdiev 2006-10-24 06:03:18 -04:00 committed by Alexandre Julliard
parent 74cd90a18a
commit 997e670e12
5 changed files with 28 additions and 18 deletions

View File

@ -256,9 +256,9 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
}
/* Initialise the state of the texture object
to the openGL defaults, not the directx defaults */
This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = D3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = D3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSW] = D3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSW] = WINED3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_BORDERCOLOR] = 0;
This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR;
This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */
@ -268,7 +268,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
This->baseTexture.states[WINED3DTEXSTA_SRGBTEXTURE] = 0;
This->baseTexture.states[WINED3DTEXSTA_ELEMENTINDEX] = 0;
This->baseTexture.states[WINED3DTEXSTA_DMAPOFFSET] = 0;
This->baseTexture.states[WINED3DTEXSTA_TSSADDRESSW] = D3DTADDRESS_WRAP;
This->baseTexture.states[WINED3DTEXSTA_TSSADDRESSW] = WINED3DTADDRESS_WRAP;
IWineD3DBaseTexture_SetDirty(iface, TRUE);
isNewTexture = TRUE;
}
@ -358,7 +358,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
case WINED3DSAMP_ADDRESSW: /* fall through */
*state = samplerStates[textureObjectSamplerStates[i].state];
if (*state < minLookup[WINELOOKUP_WARPPARAM] || *state > maxLookup[WINELOOKUP_WARPPARAM]) {
FIXME("Unrecognized or unsupported D3DTADDRESS_* value %d, state %d\n", *state, textureObjectSamplerStates[i].function);
FIXME("Unrecognized or unsupported WINED3DTADDRESS_* value %d, state %d\n", *state, textureObjectSamplerStates[i].function);
} else {
GLint wrapParm = stateLookup[WINELOOKUP_WARPPARAM][*state - minLookup[WINELOOKUP_WARPPARAM]];
TRACE("Setting WRAP_R to %d for %x\n", wrapParm, textureDimensions);

View File

@ -5510,7 +5510,7 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac
case WINED3DTSS_ADDRESSW :
#if 0 /* I'm not sure what D3D does about ADDRESSW appearing twice */
if (Value < minLookup[WINELOOKUP_WARPPARAM] || Value > maxLookup[WINELOOKUP_WARPPARAM]) {
FIXME("Unrecognized or unsupported D3DTADDRESS_* value %d, state %d\n", Value, Type);
FIXME("Unrecognized or unsupported WINED3DTADDRESS_* value %d, state %d\n", Value, Type);
} else {
GLint wrapParm = stateLookup[WINELOOKUP_WARPPARAM][Value - minLookup[WINELOOKUP_WARPPARAM]];

View File

@ -933,8 +933,8 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
/* Load all the lookup tables
TODO: It may be a good idea to make minLookup and maxLookup const and populate them in wined3d_private.h where they are declared */
minLookup[WINELOOKUP_WARPPARAM] = D3DTADDRESS_WRAP;
maxLookup[WINELOOKUP_WARPPARAM] = D3DTADDRESS_MIRRORONCE;
minLookup[WINELOOKUP_WARPPARAM] = WINED3DTADDRESS_WRAP;
maxLookup[WINELOOKUP_WARPPARAM] = WINED3DTADDRESS_MIRRORONCE;
minLookup[WINELOOKUP_MAGFILTER] = WINED3DTEXF_NONE;
maxLookup[WINELOOKUP_MAGFILTER] = WINED3DTEXF_ANISOTROPIC;
@ -944,15 +944,15 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
stateLookup[i] = HeapAlloc(GetProcessHeap(), 0, sizeof(*stateLookup[i]) * (1 + maxLookup[i] - minLookup[i]) );
}
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_WRAP - minLookup[WINELOOKUP_WARPPARAM]] = GL_REPEAT;
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_CLAMP - minLookup[WINELOOKUP_WARPPARAM]] = GL_CLAMP_TO_EDGE;
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_BORDER - minLookup[WINELOOKUP_WARPPARAM]] =
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_WRAP - minLookup[WINELOOKUP_WARPPARAM]] = GL_REPEAT;
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_CLAMP - minLookup[WINELOOKUP_WARPPARAM]] = GL_CLAMP_TO_EDGE;
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_BORDER - minLookup[WINELOOKUP_WARPPARAM]] =
gl_info->supported[ARB_TEXTURE_BORDER_CLAMP] ? GL_CLAMP_TO_BORDER_ARB : GL_REPEAT;
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_BORDER - minLookup[WINELOOKUP_WARPPARAM]] =
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_BORDER - minLookup[WINELOOKUP_WARPPARAM]] =
gl_info->supported[ARB_TEXTURE_BORDER_CLAMP] ? GL_CLAMP_TO_BORDER_ARB : GL_REPEAT;
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_MIRROR - minLookup[WINELOOKUP_WARPPARAM]] =
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_MIRROR - minLookup[WINELOOKUP_WARPPARAM]] =
gl_info->supported[ARB_TEXTURE_MIRRORED_REPEAT] ? GL_MIRRORED_REPEAT_ARB : GL_REPEAT;
stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_MIRRORONCE - minLookup[WINELOOKUP_WARPPARAM]] =
stateLookup[WINELOOKUP_WARPPARAM][WINED3DTADDRESS_MIRRORONCE - minLookup[WINELOOKUP_WARPPARAM]] =
gl_info->supported[ATI_TEXTURE_MIRROR_ONCE] ? GL_MIRROR_CLAMP_TO_EDGE_ATI : GL_REPEAT;
stateLookup[WINELOOKUP_MAGFILTER][WINED3DTEXF_NONE - minLookup[WINELOOKUP_MAGFILTER]] = GL_NEAREST;

View File

@ -999,7 +999,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
This->textureState[i][WINED3DTSS_BUMPENVLSCALE ] = (DWORD) 0.0;
This->textureState[i][WINED3DTSS_BUMPENVLOFFSET ] = (DWORD) 0.0;
This->textureState[i][WINED3DTSS_TEXTURETRANSFORMFLAGS ] = WINED3DTTFF_DISABLE;
This->textureState[i][WINED3DTSS_ADDRESSW ] = D3DTADDRESS_WRAP;
This->textureState[i][WINED3DTSS_ADDRESSW ] = WINED3DTADDRESS_WRAP;
This->textureState[i][WINED3DTSS_COLORARG0 ] = D3DTA_CURRENT;
This->textureState[i][WINED3DTSS_ALPHAARG0 ] = D3DTA_CURRENT;
This->textureState[i][WINED3DTSS_RESULTARG ] = D3DTA_CURRENT;
@ -1008,9 +1008,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
/* Sampler states*/
for (i = 0 ; i < GL_LIMITS(sampler_stages); i++) {
TRACE("Setting up default samplers states for sampler %d\n", i);
This->samplerState[i][WINED3DSAMP_ADDRESSU ] = D3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_ADDRESSV ] = D3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_ADDRESSW ] = D3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_ADDRESSU ] = WINED3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_ADDRESSV ] = WINED3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_ADDRESSW ] = WINED3DTADDRESS_WRAP;
This->samplerState[i][WINED3DSAMP_BORDERCOLOR ] = 0x00;
This->samplerState[i][WINED3DSAMP_MAGFILTER ] = WINED3DTEXF_POINT;
This->samplerState[i][WINED3DSAMP_MINFILTER ] = WINED3DTEXF_POINT;

View File

@ -593,6 +593,16 @@ typedef enum _WINED3DTEXTUREOP {
WINED3DTOP_FORCE_DWORD = 0x7fffffff,
} WINED3DTEXTUREOP;
typedef enum _WINED3DTEXTUREADDRESS {
WINED3DTADDRESS_WRAP = 1,
WINED3DTADDRESS_MIRROR = 2,
WINED3DTADDRESS_CLAMP = 3,
WINED3DTADDRESS_BORDER = 4,
WINED3DTADDRESS_MIRRORONCE = 5,
WINED3DTADDRESS_FORCE_DWORD = 0x7fffffff
} WINED3DTEXTUREADDRESS;
typedef enum _WINED3DTRANSFORMSTATETYPE {
WINED3DTS_VIEW = 2,
WINED3DTS_PROJECTION = 3,