d3dx9_36: Forward D3DXCreateTextureFromFileExW to D3DXCreateTextureFromFileInMemoryEx.

This commit is contained in:
Christian Costa 2010-04-06 21:44:16 +02:00 committed by Alexandre Julliard
parent b141e6e33b
commit 36ef502e2f
2 changed files with 38 additions and 1 deletions

View File

@ -95,7 +95,7 @@
@ stdcall D3DXCreateTexture(ptr long long long long long long ptr)
@ stub D3DXCreateTextureFromFileA
@ stub D3DXCreateTextureFromFileExA
@ stub D3DXCreateTextureFromFileExW
@ stdcall D3DXCreateTextureFromFileExW(ptr ptr long long long long long long long long long ptr ptr ptr)
@ stub D3DXCreateTextureFromFileInMemory
@ stdcall D3DXCreateTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long ptr ptr ptr)
@ stub D3DXCreateTextureFromFileW

View File

@ -70,3 +70,40 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
return E_NOTIMPL;
}
HRESULT WINAPI D3DXCreateTextureFromFileExW(LPDIRECT3DDEVICE9 device,
LPCWSTR srcfile,
UINT width,
UINT height,
UINT miplevels,
DWORD usage,
D3DFORMAT format,
D3DPOOL pool,
DWORD filter,
DWORD mipfilter,
D3DCOLOR colorkey,
D3DXIMAGE_INFO *srcinfo,
PALETTEENTRY *palette,
LPDIRECT3DTEXTURE9 *texture)
{
HRESULT hr;
DWORD size;
LPVOID buffer;
TRACE("(%p, %p, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p): relay\n", device, debugstr_w(srcfile), width,
height, miplevels, usage, format, pool, filter, mipfilter, colorkey, srcinfo, palette, texture);
if (!srcfile)
return D3DERR_INVALIDCALL;
hr = map_view_of_file(srcfile, &buffer, &size);
if (FAILED(hr))
return D3DXERR_INVALIDDATA;
hr = D3DXCreateTextureFromFileInMemoryEx(device, buffer, size, width, height, miplevels, usage, format, pool,
filter, mipfilter, colorkey, srcinfo, palette, texture);
UnmapViewOfFile(buffer);
return hr;
}