Commit 37d67eb6 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3dx9: Simplify D3DXCreateEffectFromResourceExW().

parent f60b2813
......@@ -5571,29 +5571,25 @@ HRESULT WINAPI D3DXCreateEffectFromResourceExW(struct IDirect3DDevice9 *device,
DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
{
HRSRC resinfo;
void *buffer;
DWORD size;
TRACE("(%p, %s): relay\n", srcmodule, debugstr_w(srcresource));
TRACE("device %p, srcmodule %p, srcresource %s, defines %p, include %p, skipconstants %s, "
"flags %#x, pool %p, effect %p, compilationerrors %p.\n",
device, srcmodule, debugstr_w(srcresource), defines, include, debugstr_a(skipconstants),
flags, pool, effect, compilationerrors);
if (!device)
return D3DERR_INVALIDCALL;
resinfo = FindResourceW(srcmodule, srcresource, (LPCWSTR) RT_RCDATA);
if (resinfo)
{
LPVOID buffer;
HRESULT ret;
DWORD size;
ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
if (FAILED(ret))
return D3DXERR_INVALIDDATA;
if (!(resinfo = FindResourceW(srcmodule, srcresource, (const WCHAR *)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
return D3DXCreateEffectEx(device, buffer, size, defines, include, skipconstants, flags, pool, effect, compilationerrors);
}
if (FAILED(load_resource_into_memory(srcmodule, resinfo, &buffer, &size)))
return D3DXERR_INVALIDDATA;
return D3DXERR_INVALIDDATA;
return D3DXCreateEffectEx(device, buffer, size, defines, include,
skipconstants, flags, pool, effect, compilationerrors);
}
HRESULT WINAPI D3DXCreateEffectFromResourceExA(struct IDirect3DDevice9 *device, HMODULE srcmodule,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment