d3dx9: Simplify D3DXCreateEffectFromResourceExW().
This commit is contained in:
parent
f60b28138e
commit
37d67eb629
|
@ -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 = FindResourceW(srcmodule, srcresource, (const WCHAR *)RT_RCDATA)))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
if (resinfo)
|
||||
{
|
||||
LPVOID buffer;
|
||||
HRESULT ret;
|
||||
DWORD size;
|
||||
if (FAILED(load_resource_into_memory(srcmodule, resinfo, &buffer, &size)))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
|
||||
|
||||
if (FAILED(ret))
|
||||
return D3DXERR_INVALIDDATA;
|
||||
|
||||
return D3DXCreateEffectEx(device, buffer, size, defines, include, skipconstants, flags, pool, effect, compilationerrors);
|
||||
}
|
||||
|
||||
return D3DXERR_INVALIDDATA;
|
||||
return D3DXCreateEffectEx(device, buffer, size, defines, include,
|
||||
skipconstants, flags, pool, effect, compilationerrors);
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DXCreateEffectFromResourceExA(struct IDirect3DDevice9 *device, HMODULE srcmodule,
|
||||
|
|
Loading…
Reference in New Issue