Commit 2a24b11a authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3dx9: Avoid LPWSTR.

parent 0be8e524
......@@ -5531,11 +5531,14 @@ HRESULT WINAPI D3DXCreateEffectFromFileExA(struct IDirect3DDevice9 *device, cons
const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags,
struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors)
{
LPWSTR srcfileW;
WCHAR *srcfileW;
HRESULT ret;
DWORD len;
TRACE("(void): relay\n");
TRACE("device %p, srcfile %s, defines %p, include %p, skipconstants %s, "
"flags %#x, pool %p, effect %p, compilationerrors %p.\n",
device, debugstr_a(srcfile), defines, include, debugstr_a(skipconstants),
flags, pool, effect, compilationerrors);
if (!srcfile)
return D3DERR_INVALIDCALL;
......@@ -5660,11 +5663,12 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(const WCHAR *srcfile, const D3D
HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(const char *srcfile, const D3DXMACRO *defines,
ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors)
{
LPWSTR srcfileW;
WCHAR *srcfileW;
HRESULT ret;
DWORD len;
TRACE("(void): relay\n");
TRACE("srcfile %s, defines %p, include %p, flags %#x, effectcompiler %p, parseerrors %p.\n",
debugstr_a(srcfile), defines, include, flags, effectcompiler, parseerrors);
if (!srcfile)
return D3DERR_INVALIDCALL;
......
......@@ -3673,12 +3673,14 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXA(const char *filename, DWORD options,
struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data,
D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
{
WCHAR *filenameW;
HRESULT hr;
int len;
LPWSTR filenameW;
TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options,
device, alloc_hier, load_user_data, frame_hierarchy, anim_controller);
TRACE("filename %s, options %#x, device %p, alloc_hier %p, "
"load_user_data %p, frame_hierarchy %p, anim_controller %p.\n",
debugstr_a(filename), options, device, alloc_hier,
load_user_data, frame_hierarchy, anim_controller);
if (!filename)
return D3DERR_INVALIDCALL;
......@@ -4025,12 +4027,14 @@ HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct ID
struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances,
DWORD *num_materials, struct ID3DXMesh **mesh)
{
WCHAR *filenameW;
HRESULT hr;
int len;
LPWSTR filenameW;
TRACE("(%s, %x, %p, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options,
device, adjacency, materials, effect_instances, num_materials, mesh);
TRACE("filename %s, options %#x, device %p, adjacency %p, materials %p, "
"effect_instances %p, num_materials %p, mesh %p.\n",
debugstr_a(filename), options, device, adjacency, materials,
effect_instances, num_materials, mesh);
if (!filename)
return D3DERR_INVALIDCALL;
......@@ -4943,12 +4947,12 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device,
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation,
float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
{
WCHAR *textW;
HRESULT hr;
int len;
LPWSTR textW;
TRACE("(%p, %p, %s, %f, %f, %p, %p, %p)\n", device, hdc,
debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics);
TRACE("device %p, hdc %p, text %s, deviation %.8e, extrusion %.8e, mesh %p, adjacency %p, glyphmetrics %p.\n",
device, hdc, debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics);
if (!text)
return D3DERR_INVALIDCALL;
......
......@@ -284,10 +284,13 @@ struct D3DXIncludeImpl {
HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines,
ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
{
LPWSTR filename_w = NULL;
WCHAR *filename_w;
DWORD len;
HRESULT ret;
TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
debugstr_a(filename), defines, include, flags, shader, error_messages);
if (!filename) return D3DXERR_INVALIDDATA;
len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
......@@ -387,10 +390,15 @@ HRESULT WINAPI D3DXCompileShaderFromFileA(const char *filename, const D3DXMACRO
ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags,
ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
{
LPWSTR filename_w = NULL;
WCHAR *filename_w;
DWORD len;
HRESULT ret;
TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
"flags %#x, shader %p, error_messages %p, constant_table %p.\n",
debugstr_a(filename), defines, include, debugstr_a(entrypoint),
debugstr_a(profile), flags, shader, error_messages, constant_table);
if (!filename) return D3DXERR_INVALIDDATA;
len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
......
......@@ -901,11 +901,11 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
*/
HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info)
{
LPWSTR widename;
WCHAR *widename;
HRESULT hr;
int strlength;
TRACE("(%s, %p): relay\n", debugstr_a(file), info);
TRACE("file %s, info %p.\n", debugstr_a(file), info);
if( !file ) return D3DERR_INVALIDCALL;
......@@ -1188,7 +1188,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file,
const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
{
LPWSTR pWidename;
WCHAR *src_file_w;
HRESULT hr;
int strlength;
......@@ -1201,12 +1201,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface,
return D3DERR_INVALIDCALL;
strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0);
pWidename = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*pWidename));
MultiByteToWideChar(CP_ACP, 0, src_file, -1, pWidename, strlength);
src_file_w = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*src_file_w));
MultiByteToWideChar(CP_ACP, 0, src_file, -1, src_file_w, strlength);
hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect,
pWidename, src_rect, filter, color_key, src_info);
HeapFree(GetProcessHeap(), 0, pWidename);
src_file_w, src_rect, filter, color_key, src_info);
HeapFree(GetProcessHeap(), 0, src_file_w);
return hr;
}
......
......@@ -719,13 +719,14 @@ HRESULT WINAPI D3DXCreateTextureFromFileExA(struct IDirect3DDevice9 *device, con
D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo,
PALETTEENTRY *palette, struct IDirect3DTexture9 **texture)
{
LPWSTR widename;
WCHAR *widename;
HRESULT hr;
DWORD len;
TRACE("(%p, %s, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p): relay\n",
device, debugstr_a(srcfile), width, height, miplevels, usage, format, pool, filter,
mipfilter, colorkey, srcinfo, palette, texture);
TRACE("device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, "
"pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n",
device, debugstr_a(srcfile), width, height, miplevels, usage, format,
pool, filter, mipfilter, colorkey, srcinfo, palette, texture);
if (!device || !srcfile || !texture)
return D3DERR_INVALIDCALL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment