=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9: Use actual level count for computing the number of loaded mipmaps.
Alexandre Julliard
julliard at winehq.org
Mon May 21 15:31:07 CDT 2012
Module: wine
Branch: master
Commit: 1a4f1edf3233d476e7441da1903f19ca8c1fd8df
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1a4f1edf3233d476e7441da1903f19ca8c1fd8df
Author: Józef Kucia <joseph.kucia at gmail.com>
Date: Fri May 18 15:50:10 2012 +0200
d3dx9: Use actual level count for computing the number of loaded mipmaps.
---
dlls/d3dx9_36/texture.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 377e4f6..8ca42c5 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -636,7 +636,7 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
return hr;
}
- loaded_miplevels = min(miplevels, imginfo.MipLevels);
+ loaded_miplevels = min(IDirect3DTexture9_GetLevelCount(*texptr), imginfo.MipLevels);
hr = D3DXFilterTexture((IDirect3DBaseTexture9*) *texptr, palette, loaded_miplevels - 1, mipfilter);
if (FAILED(hr))
@@ -1209,7 +1209,7 @@ HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device,
return hr;
}
- loaded_miplevels = min(mip_levels, img_info.MipLevels);
+ loaded_miplevels = min(IDirect3DCubeTexture9_GetLevelCount(tex), img_info.MipLevels);
hr = D3DXFilterTexture((IDirect3DBaseTexture9*) tex, palette, loaded_miplevels - 1, mip_filter);
if (FAILED(hr))
{
More information about the wine-cvs
mailing list