Commit 8d8b7ffb authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

wined3d: Handle out of array bounds state.

parent cd2f10a6
......@@ -435,16 +435,17 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
state = samplerStates[WINED3DSAMP_MAGFILTER];
if (state < WINED3DTEXF_NONE || state > WINED3DTEXF_ANISOTROPIC) {
FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state);
} else {
glValue = (*This->baseTexture.magLookup)[state - WINED3DTEXF_NONE];
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
/* We need to reset the Anisotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */
if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == state &&
textureDimensions != GL_TEXTURE_RECTANGLE_ARB) {
glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]);
}
This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = state;
}
glValue = (*This->baseTexture.magLookup)[state - WINED3DTEXF_NONE];
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
/* We need to reset the Anisotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */
if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == state &&
textureDimensions != GL_TEXTURE_RECTANGLE_ARB) {
glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]);
}
This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = state;
}
if(textureDimensions != GL_TEXTURE_RECTANGLE_ARB &&
......
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