d3dx9: Simplify D3DXCreateEffectCompilerFromResourceA().

This commit is contained in:
Henri Verbeet 2013-08-26 09:23:40 +02:00 committed by Alexandre Julliard
parent aee3c0faeb
commit 1be05ff731
1 changed files with 9 additions and 16 deletions

View File

@ -5684,26 +5684,19 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromResourceA(HMODULE srcmodule, const ch
ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
{
HRSRC resinfo;
TRACE("(%p, %s): relay\n", srcmodule, debugstr_a(srcresource));
resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) RT_RCDATA);
if (resinfo)
{
LPVOID buffer;
HRESULT ret;
void *buffer;
DWORD size;
ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
TRACE("srcmodule %p, srcresource %s, defines %p, include %p, flags %#x, effectcompiler %p, parseerrors %p.\n",
srcmodule, debugstr_a(srcresource), defines, include, flags, effectcompiler, parseerrors);
if (FAILED(ret))
if (!(resinfo = FindResourceA(srcmodule, srcresource, (const char *)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (FAILED(load_resource_into_memory(srcmodule, resinfo, &buffer, &size)))
return D3DXERR_INVALIDDATA;
return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
}
return D3DXERR_INVALIDDATA;
}
HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule, const WCHAR *srcresource,