Commit f60b2813 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3dx9: Simplify D3DXCreateEffectFromResourceExA().

parent b4d6f90f
......@@ -5601,29 +5601,25 @@ HRESULT WINAPI D3DXCreateEffectFromResourceExA(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_a(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_a(srcresource), defines, include, debugstr_a(skipconstants),
flags, pool, effect, compilationerrors);
if (!device)
return D3DERR_INVALIDCALL;
resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) 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 = FindResourceA(srcmodule, srcresource, (const char *)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 D3DXCreateEffectFromResourceW(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