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) ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
{ {
HRSRC resinfo; HRSRC resinfo;
void *buffer;
DWORD size;
TRACE("(%p, %s): relay\n", srcmodule, debugstr_a(srcresource)); 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);
resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) RT_RCDATA); if (!(resinfo = FindResourceA(srcmodule, srcresource, (const char *)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (resinfo) if (FAILED(load_resource_into_memory(srcmodule, resinfo, &buffer, &size)))
{ return D3DXERR_INVALIDDATA;
LPVOID buffer;
HRESULT ret;
DWORD size;
ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size); return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
if (FAILED(ret))
return D3DXERR_INVALIDDATA;
return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
}
return D3DXERR_INVALIDDATA;
} }
HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule, const WCHAR *srcresource, HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule, const WCHAR *srcresource,