Commit 176d27e8 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3dx9: Use wine_dbgstr_rect() in some more places.

parent 34c9586b
...@@ -145,10 +145,11 @@ static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface) ...@@ -145,10 +145,11 @@ static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface)
} }
static HRESULT WINAPI ID3DXFontImpl_GetGlyphData(ID3DXFont *iface, UINT glyph, static HRESULT WINAPI ID3DXFontImpl_GetGlyphData(ID3DXFont *iface, UINT glyph,
LPDIRECT3DTEXTURE9 *texture, RECT *blackbox, POINT *cellinc) IDirect3DTexture9 **texture, RECT *blackbox, POINT *cellinc)
{ {
ID3DXFontImpl *This=impl_from_ID3DXFont(iface); FIXME("iface %p, glyph %#x, texture %p, baclbox %s, cellinc %s stub!\n",
FIXME("(%p)->(%u, %p, %p, %p): stub\n", This, glyph, texture, blackbox, cellinc); iface, glyph, texture, wine_dbgstr_rect(blackbox), wine_dbgstr_point(cellinc));
return D3D_OK; return D3D_OK;
} }
...@@ -180,19 +181,19 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, LPCWSTR strin ...@@ -180,19 +181,19 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, LPCWSTR strin
return D3D_OK; return D3D_OK;
} }
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, LPD3DXSPRITE sprite, LPCSTR string, static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
INT count, LPRECT rect, DWORD format, D3DCOLOR color) const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{ {
ID3DXFontImpl *This=impl_from_ID3DXFont(iface); FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
FIXME("(%p)->(%p, %s, %d, %p, %d, %#x): stub\n", This, sprite, string, count, rect, format, color); iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
return 1; return 1;
} }
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, LPD3DXSPRITE sprite, LPCWSTR string, static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
INT count, LPRECT rect, DWORD format, D3DCOLOR color) const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{ {
ID3DXFontImpl *This=impl_from_ID3DXFont(iface); FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
FIXME("(%p)->(%p, %s, %d, %p, %d, %#x): stub\n", This, sprite, debugstr_w(string), count, rect, format, color); iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
return 1; return 1;
} }
......
...@@ -317,13 +317,14 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) ...@@ -317,13 +317,14 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often)
return D3D_OK; return D3D_OK;
} }
static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, LPDIRECT3DTEXTURE9 texture, static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, IDirect3DTexture9 *texture,
CONST RECT *rect, CONST D3DXVECTOR3 *center, CONST D3DXVECTOR3 *position, D3DCOLOR color) const RECT *rect, const D3DXVECTOR3 *center, const D3DXVECTOR3 *position, D3DCOLOR color)
{ {
ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface);
D3DSURFACE_DESC texdesc; D3DSURFACE_DESC texdesc;
TRACE("(%p)->(%p, %p, %p, %p, %#x): relay\n", This, texture, rect, center, position, color); TRACE("iface %p, texture %p, rect %s, center %p, position %p, color 0x%08x.\n",
iface, texture, wine_dbgstr_rect(rect), center, position, color);
if(texture==NULL) return D3DERR_INVALIDCALL; if(texture==NULL) return D3DERR_INVALIDCALL;
if(!This->ready) return D3DERR_INVALIDCALL; if(!This->ready) return D3DERR_INVALIDCALL;
......
...@@ -767,15 +767,9 @@ HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D ...@@ -767,15 +767,9 @@ HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D
* D3DXERR_INVALIDDATA, if pSrcData is no valid image file * D3DXERR_INVALIDDATA, if pSrcData is no valid image file
* *
*/ */
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface, HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
CONST PALETTEENTRY *pDestPalette, const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize,
CONST RECT *pDestRect, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)
LPCVOID pSrcData,
UINT SrcDataSize,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
{ {
D3DXIMAGE_INFO imginfo; D3DXIMAGE_INFO imginfo;
HRESULT hr; HRESULT hr;
...@@ -789,8 +783,10 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface, ...@@ -789,8 +783,10 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
WICRect wicrect; WICRect wicrect;
RECT rect; RECT rect;
TRACE("(%p, %p, %p, %p, %d, %p, %d, %x, %p)\n", pDestSurface, pDestPalette, pDestRect, pSrcData, TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, "
SrcDataSize, pSrcRect, dwFilter, Colorkey, pSrcInfo); "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
pDestSurface, pDestPalette, wine_dbgstr_rect(pDestRect), pSrcData, SrcDataSize,
wine_dbgstr_rect(pSrcRect), dwFilter, Colorkey, pSrcInfo);
if (!pDestSurface || !pSrcData || !SrcDataSize) if (!pDestSurface || !pSrcData || !SrcDataSize)
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
...@@ -897,136 +893,126 @@ cleanup_err: ...@@ -897,136 +893,126 @@ cleanup_err:
return D3D_OK; return D3D_OK;
} }
/************************************************************ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface,
* D3DXLoadSurfaceFromFile 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)
HRESULT WINAPI D3DXLoadSurfaceFromFileA(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
LPCSTR pSrcFile,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
{ {
LPWSTR pWidename; LPWSTR pWidename;
HRESULT hr; HRESULT hr;
int strlength; int strlength;
TRACE("(%p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, debugstr_a(pSrcFile), TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
pSrcRect, dwFilter, Colorkey, pSrcInfo); "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_a(src_file),
wine_dbgstr_rect(src_rect), filter, color_key, src_info);
if( !pSrcFile || !pDestSurface ) return D3DERR_INVALIDCALL; if (!src_file || !dst_surface)
return D3DERR_INVALIDCALL;
strlength = MultiByteToWideChar(CP_ACP, 0, pSrcFile, -1, NULL, 0); strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0);
pWidename = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*pWidename)); pWidename = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*pWidename));
MultiByteToWideChar(CP_ACP, 0, pSrcFile, -1, pWidename, strlength); MultiByteToWideChar(CP_ACP, 0, src_file, -1, pWidename, strlength);
hr = D3DXLoadSurfaceFromFileW(pDestSurface, pDestPalette, pDestRect, pWidename, pSrcRect, dwFilter, Colorkey, pSrcInfo); hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect,
pWidename, src_rect, filter, color_key, src_info);
HeapFree(GetProcessHeap(), 0, pWidename); HeapFree(GetProcessHeap(), 0, pWidename);
return hr; return hr;
} }
HRESULT WINAPI D3DXLoadSurfaceFromFileW(LPDIRECT3DSURFACE9 pDestSurface, HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface,
CONST PALETTEENTRY *pDestPalette, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file,
CONST RECT *pDestRect, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
LPCWSTR pSrcFile,
CONST RECT *pSrcRect,
DWORD Filter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
{ {
UINT data_size;
void *data;
HRESULT hr; HRESULT hr;
DWORD dwSize;
LPVOID pBuffer;
TRACE("(%p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, debugstr_w(pSrcFile), TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
pSrcRect, Filter, Colorkey, pSrcInfo); "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), debugstr_w(src_file),
wine_dbgstr_rect(src_rect), filter, color_key, src_info);
if( !pSrcFile || !pDestSurface ) return D3DERR_INVALIDCALL; if (!src_file || !dst_surface)
return D3DERR_INVALIDCALL;
hr = map_view_of_file(pSrcFile, &pBuffer, &dwSize); if (FAILED(map_view_of_file(src_file, &data, &data_size)))
if(FAILED(hr)) return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
hr = D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, Filter, Colorkey, pSrcInfo); hr = D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect,
UnmapViewOfFile(pBuffer); data, data_size, src_rect, filter, color_key, src_info);
UnmapViewOfFile(data);
return hr; return hr;
} }
/************************************************************ HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface,
* D3DXLoadSurfaceFromResource const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const char *resource,
*/ const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
HRESULT WINAPI D3DXLoadSurfaceFromResourceA(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
HMODULE hSrcModule,
LPCSTR pResource,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
{ {
HRSRC hResInfo; HRSRC hResInfo;
TRACE("(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, hSrcModule, TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
debugstr_a(pResource), pSrcRect, dwFilter, Colorkey, pSrcInfo); "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_a(resource),
wine_dbgstr_rect(src_rect), filter, color_key, src_info);
if( !pDestSurface ) return D3DERR_INVALIDCALL; if (!dst_surface)
return D3DERR_INVALIDCALL;
hResInfo = FindResourceA(hSrcModule, pResource, (LPCSTR)RT_RCDATA); if ((hResInfo = FindResourceA(src_module, resource, (const char *)RT_RCDATA)))
if(hResInfo) { {
LPVOID pBuffer; UINT data_size;
HRESULT hr; void *data;
DWORD dwSize;
hr = load_resource_into_memory(hSrcModule, hResInfo, &pBuffer, &dwSize); if (FAILED(load_resource_into_memory(src_module, hResInfo, &data, &data_size)))
if(FAILED(hr)) return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
return D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect,
data, data_size, src_rect, filter, color_key, src_info);
} }
hResInfo = FindResourceA(hSrcModule, pResource, (LPCSTR)RT_BITMAP); if ((hResInfo = FindResourceA(src_module, resource, (const char *)RT_BITMAP)))
if(hResInfo) { {
FIXME("Implement loading bitmaps from resource type RT_BITMAP\n"); FIXME("Implement loading bitmaps from resource type RT_BITMAP.\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
} }
HRESULT WINAPI D3DXLoadSurfaceFromResourceW(LPDIRECT3DSURFACE9 pDestSurface, HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface,
CONST PALETTEENTRY *pDestPalette, const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource,
CONST RECT *pDestRect, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
HMODULE hSrcModule,
LPCWSTR pResource,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
{ {
HRSRC hResInfo; HRSRC hResInfo;
TRACE("(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, hSrcModule, TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
debugstr_w(pResource), pSrcRect, dwFilter, Colorkey, pSrcInfo); "src_rect %s, filter %#x, color_key 0x%08x, src_info %p.\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_module, debugstr_w(resource),
wine_dbgstr_rect(src_rect), filter, color_key, src_info);
if( !pDestSurface ) return D3DERR_INVALIDCALL; if (!dst_surface)
return D3DERR_INVALIDCALL;
hResInfo = FindResourceW(hSrcModule, pResource, (LPCWSTR)RT_RCDATA); if ((hResInfo = FindResourceW(src_module, resource, (const WCHAR *)RT_RCDATA)))
if(hResInfo) { {
LPVOID pBuffer; UINT data_size;
HRESULT hr; void *data;
DWORD dwSize;
hr = load_resource_into_memory(hSrcModule, hResInfo, &pBuffer, &dwSize); if (FAILED(load_resource_into_memory(src_module, hResInfo, &data, &data_size)))
if(FAILED(hr)) return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
return D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
return D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect,
data, data_size, src_rect, filter, color_key, src_info);
} }
hResInfo = FindResourceW(hSrcModule, pResource, (LPCWSTR)RT_BITMAP); if ((hResInfo = FindResourceW(src_module, resource, (const WCHAR *)RT_BITMAP)))
if(hResInfo) { {
FIXME("Implement loading bitmaps from resource type RT_BITMAP\n"); FIXME("Implement loading bitmaps from resource type RT_BITMAP.\n");
return E_NOTIMPL; return E_NOTIMPL;
} }
return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
} }
...@@ -1543,38 +1529,38 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, ...@@ -1543,38 +1529,38 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
* D3DXERR_INVALIDDATA, if one of the surfaces is not lockable * D3DXERR_INVALIDDATA, if one of the surfaces is not lockable
* *
*/ */
HRESULT WINAPI D3DXLoadSurfaceFromSurface(LPDIRECT3DSURFACE9 pDestSurface, HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface,
CONST PALETTEENTRY *pDestPalette, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface,
CONST RECT *pDestRect, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY *pSrcPalette,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey)
{ {
RECT rect; RECT rect;
D3DLOCKED_RECT lock; D3DLOCKED_RECT lock;
D3DSURFACE_DESC SrcDesc; D3DSURFACE_DESC SrcDesc;
HRESULT hr; HRESULT hr;
TRACE("(%p, %p, %p, %p, %p, %p, %u, %#x): relay\n", pDestSurface, pDestPalette, pDestRect, TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_surface %p, "
pSrcSurface, pSrcPalette, pSrcRect, dwFilter, Colorkey); "src_palette %p, src_rect %s, filter %#x, color_key 0x%08x.\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_surface,
src_palette, wine_dbgstr_rect(src_rect), filter, color_key);
if( !pDestSurface || !pSrcSurface ) return D3DERR_INVALIDCALL; if (!dst_surface || !src_surface)
return D3DERR_INVALIDCALL;
IDirect3DSurface9_GetDesc(pSrcSurface, &SrcDesc); IDirect3DSurface9_GetDesc(src_surface, &SrcDesc);
if( !pSrcRect ) SetRect(&rect, 0, 0, SrcDesc.Width, SrcDesc.Height); if (!src_rect)
else rect = *pSrcRect; SetRect(&rect, 0, 0, SrcDesc.Width, SrcDesc.Height);
else
rect = *src_rect;
hr = IDirect3DSurface9_LockRect(pSrcSurface, &lock, NULL, D3DLOCK_READONLY); if (FAILED(IDirect3DSurface9_LockRect(src_surface, &lock, NULL, D3DLOCK_READONLY)))
if(FAILED(hr)) return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
hr = D3DXLoadSurfaceFromMemory(dst_surface, dst_palette, dst_rect,
lock.pBits, SrcDesc.Format, lock.Pitch, src_palette, &rect, filter, color_key);
hr = D3DXLoadSurfaceFromMemory(pDestSurface, pDestPalette, pDestRect, IDirect3DSurface9_UnlockRect(src_surface);
lock.pBits, SrcDesc.Format, lock.Pitch,
pSrcPalette, &rect, dwFilter, Colorkey);
IDirect3DSurface9_UnlockRect(pSrcSurface);
return hr; return hr;
} }
......
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