diff --git a/dlls/d3dx10_43/compiler.c b/dlls/d3dx10_43/compiler.c index 932bdadea1a..0bda2712d76 100644 --- a/dlls/d3dx10_43/compiler.c +++ b/dlls/d3dx10_43/compiler.c @@ -18,6 +18,7 @@ */ #include "wine/debug.h" +#include "wine/heap.h" #define COBJMACROS @@ -93,3 +94,32 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH return hr; } + +HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, + ID3D10Include *include, const char *profile, UINT shader_flags, UINT effect_flags, + ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3DX10ThreadPump *pump, + ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult) +{ + WCHAR *filenameW; + HRESULT hr; + int len; + + TRACE("filename %s, defines %p, include %p, profile %s, shader_flags %#x, effect_flags %#x, " + "device %p, effect_pool %p, pump %p, effect %p, errors %p, hresult %p.\n", + debugstr_a(filename), defines, include, debugstr_a(profile), shader_flags, effect_flags, + device, effect_pool, pump, effect, errors, hresult); + + if (!filename) + return E_INVALIDARG; + + len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); + if (!(filenameW = heap_alloc(len * sizeof(*filenameW)))) + return E_OUTOFMEMORY; + MultiByteToWideChar(CP_ACP, 0, filename, -1, filenameW, len); + + hr = D3DX10CreateEffectFromFileW(filenameW, defines, include, profile, shader_flags, + effect_flags, device, effect_pool, pump, effect, errors, hresult); + heap_free(filenameW); + + return hr; +} diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index 2c53924ac20..42f29ad6239 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -48,19 +48,6 @@ BOOL WINAPI D3DX10CheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers) return FALSE; } -HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, - ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, - ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, - HRESULT *hresult) -{ - FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " - "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", - debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, - device, effectpool, pump, effect, errors, hresult); - - return E_NOTIMPL; -} - HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(const void *data, SIZE_T datasize, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool,