d3dx9_36: Don't check the image format in D3DXLoadSurfaceFromFileInMemory.

If the format is not supported, D3DXGetImageInfoFromFileInMemory will fail.
This commit is contained in:
Vincent Povirk 2010-11-08 12:57:45 -06:00 committed by Alexandre Julliard
parent 384b95533d
commit 31682b3dbe
1 changed files with 84 additions and 98 deletions

View File

@ -314,6 +314,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
D3DXIMAGE_INFO imginfo;
HRESULT hr;
IWICImagingFactory *factory;
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *bitmapframe;
IWICStream *stream;
const PixelFormatDesc *formatdesc;
WICRect wicrect;
RECT rect;
TRACE("(%p, %p, %p, %p, %d, %p, %d, %x, %p)\n", pDestSurface, pDestPalette, pDestRect, pSrcData,
SrcDataSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
@ -325,21 +334,6 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
if (FAILED(hr))
return hr;
switch (imginfo.ImageFileFormat)
{
case D3DXIFF_BMP:
case D3DXIFF_PNG:
case D3DXIFF_JPG:
{
IWICImagingFactory *factory;
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *bitmapframe;
IWICStream *stream;
const PixelFormatDesc *formatdesc;
WICRect wicrect;
RECT rect;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (FAILED(CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&factory)))
@ -421,14 +415,6 @@ cleanup_err:
if (FAILED(hr))
return D3DXERR_INVALIDDATA;
break;
}
default:
FIXME("Unsupported image file format\n");
return E_NOTIMPL;
}
if (pSrcInfo)
*pSrcInfo = imginfo;