Matteo Bruni : d3dx9: Allow implicit conversions in D3DXCreateTextureFromFileInMemoryEx.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 27 15:20:55 CDT 2014
Module: wine
Branch: master
Commit: 5aeb834dd4e7b9ed32fb3ffee532e7bcebce2bdb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5aeb834dd4e7b9ed32fb3ffee532e7bcebce2bdb
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Wed Aug 27 18:40:50 2014 +0200
d3dx9: Allow implicit conversions in D3DXCreateTextureFromFileInMemoryEx.
They should be generally supported by the existing code.
Specific missing format conversions are caught and reported by
D3DXLoadSurfaceFromMemory(), which is called directly or indirectly
from here.
---
dlls/d3dx9_36/texture.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 47c3c1d..7ebe264 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -546,8 +546,6 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi
IDirect3DTexture9 **texptr;
IDirect3DTexture9 *buftex;
IDirect3DSurface9 *surface;
- BOOL file_width = FALSE, file_height = FALSE;
- BOOL file_format = FALSE, file_miplevels = FALSE;
BOOL dynamic_texture;
D3DXIMAGE_INFO imginfo;
UINT loaded_miplevels, skip_levels;
@@ -590,25 +588,21 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi
if (width == D3DX_FROM_FILE)
{
- file_width = TRUE;
width = imginfo.Width;
}
if (height == D3DX_FROM_FILE)
{
- file_height = TRUE;
height = imginfo.Height;
}
if (format == D3DFMT_FROM_FILE)
{
- file_format = TRUE;
format = imginfo.Format;
}
if (miplevels == D3DX_FROM_FILE)
{
- file_miplevels = TRUE;
miplevels = imginfo.MipLevels;
}
@@ -648,14 +642,6 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi
miplevels = 1;
}
- if (((file_width) && (width != imginfo.Width)) ||
- ((file_height) && (height != imginfo.Height)) ||
- ((file_format) && (format != imginfo.Format)) ||
- ((file_miplevels) && (miplevels != imginfo.MipLevels)))
- {
- return D3DERR_NOTAVAILABLE;
- }
-
if (FAILED(IDirect3DDevice9_GetDeviceCaps(device, &caps)))
return D3DERR_INVALIDCALL;
More information about the wine-cvs
mailing list