Module: wine
Branch: master
Commit: 8d8b7ffbc79332f7748f8749d7bf30696253d0b9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d8b7ffbc79332f7748f8749d…
Author: Marcus Meissner <marcus(a)jet.franken.de>
Date: Wed Apr 16 22:54:28 2008 +0200
wined3d: Handle out of array bounds state.
---
dlls/wined3d/basetexture.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c
index 000c2f2..1f14a20 100644
--- a/dlls/wined3d/basetexture.c
+++ b/dlls/wined3d/basetexture.c
@@ -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 &&