=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9: Allow D3DX_DEFAULT to be passed as srclevel to D3DXFilterTexture.
Alexandre Julliard
julliard at winehq.org
Mon Jul 23 13:54:24 CDT 2012
Module: wine
Branch: master
Commit: 2c1968aef99fd51e715c8ed89e23fc25e249416a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2c1968aef99fd51e715c8ed89e23fc25e249416a
Author: Józef Kucia <joseph.kucia at gmail.com>
Date: Mon Jul 23 14:37:45 2012 +0200
d3dx9: Allow D3DX_DEFAULT to be passed as srclevel to D3DXFilterTexture.
---
dlls/d3dx9_36/tests/texture.c | 3 +++
dlls/d3dx9_36/texture.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index 95e1dc5..1edfe9e 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -758,6 +758,9 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device)
if (SUCCEEDED(hr))
{
+ hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, D3DX_DEFAULT, D3DX_FILTER_NONE);
+ ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK);
+
hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, NULL, 0, D3DX_FILTER_NONE);
ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK);
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index ec9bad9..2d94f72 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -78,7 +78,9 @@ HRESULT WINAPI D3DXFilterTexture(IDirect3DBaseTexture9 *texture,
if ((filter & 0xFFFF) > D3DX_FILTER_BOX && filter != D3DX_DEFAULT)
return D3DERR_INVALIDCALL;
- if (srclevel >= IDirect3DBaseTexture9_GetLevelCount(texture))
+ if (srclevel == D3DX_DEFAULT)
+ srclevel = 0;
+ else if (srclevel >= IDirect3DBaseTexture9_GetLevelCount(texture))
return D3DERR_INVALIDCALL;
switch (type = IDirect3DBaseTexture9_GetType(texture))
More information about the wine-cvs
mailing list