d3dx9_36: Don't check the image format in D3DXLoadSurfaceFromFileInMemory.
If the format is not supported, D3DXGetImageInfoFromFileInMemory will fail.
This commit is contained in:
parent
384b95533d
commit
31682b3dbe
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue