[PATCH 4/5] d3dx9: Simplify D3DXCreateEffectCompilerFromResourceA().

Henri Verbeet hverbeet at codeweavers.com
Mon Aug 26 02:23:40 CDT 2013


---
 dlls/d3dx9_36/effect.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index c349acf..2be1900 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -5684,26 +5684,19 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromResourceA(HMODULE srcmodule, const ch
         ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
 {
     HRSRC resinfo;
+    void *buffer;
+    DWORD size;
 
-    TRACE("(%p, %s): relay\n", srcmodule, debugstr_a(srcresource));
-
-    resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) RT_RCDATA);
-
-    if (resinfo)
-    {
-        LPVOID buffer;
-        HRESULT ret;
-        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))
-            return D3DXERR_INVALIDDATA;
+    if (!(resinfo = FindResourceA(srcmodule, srcresource, (const char *)RT_RCDATA)))
+        return D3DXERR_INVALIDDATA;
 
-        return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
-    }
+    if (FAILED(load_resource_into_memory(srcmodule, resinfo, &buffer, &size)))
+        return D3DXERR_INVALIDDATA;
 
-    return D3DXERR_INVALIDDATA;
+    return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
 }
 
 HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule, const WCHAR *srcresource,
-- 
1.8.1.5




More information about the wine-patches mailing list