d3dx9: Use wine_dbgstr_rect() in some more places.

This commit is contained in:
Henri Verbeet 2012-06-01 17:22:50 +02:00 committed by Alexandre Julliard
parent 34c9586b60
commit 176d27e889
3 changed files with 116 additions and 128 deletions

View File

@ -145,10 +145,11 @@ static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface)
}
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("(%p)->(%u, %p, %p, %p): stub\n", This, glyph, texture, blackbox, cellinc);
FIXME("iface %p, glyph %#x, texture %p, baclbox %s, cellinc %s stub!\n",
iface, glyph, texture, wine_dbgstr_rect(blackbox), wine_dbgstr_point(cellinc));
return D3D_OK;
}
@ -180,19 +181,19 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, LPCWSTR strin
return D3D_OK;
}
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, LPD3DXSPRITE sprite, LPCSTR string,
INT count, LPRECT rect, DWORD format, D3DCOLOR color)
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
ID3DXFontImpl *This=impl_from_ID3DXFont(iface);
FIXME("(%p)->(%p, %s, %d, %p, %d, %#x): stub\n", This, sprite, string, count, rect, format, color);
FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
return 1;
}
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, LPD3DXSPRITE sprite, LPCWSTR string,
INT count, LPRECT rect, DWORD format, D3DCOLOR color)
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
{
ID3DXFontImpl *This=impl_from_ID3DXFont(iface);
FIXME("(%p)->(%p, %s, %d, %p, %d, %#x): stub\n", This, sprite, debugstr_w(string), count, rect, format, color);
FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
return 1;
}

View File

@ -317,13 +317,14 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often)
return D3D_OK;
}
static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, LPDIRECT3DTEXTURE9 texture,
CONST RECT *rect, CONST D3DXVECTOR3 *center, CONST D3DXVECTOR3 *position, D3DCOLOR color)
static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, IDirect3DTexture9 *texture,
const RECT *rect, const D3DXVECTOR3 *center, const D3DXVECTOR3 *position, D3DCOLOR color)
{
ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface);
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(!This->ready) return D3DERR_INVALIDCALL;

View File

@ -767,15 +767,9 @@ HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D
* D3DXERR_INVALIDDATA, if pSrcData is no valid image file
*
*/
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
LPCVOID pSrcData,
UINT SrcDataSize,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
const PALETTEENTRY *pDestPalette, const RECT *pDestRect, const void *pSrcData, UINT SrcDataSize,
const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo)
{
D3DXIMAGE_INFO imginfo;
HRESULT hr;
@ -789,8 +783,10 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
WICRect wicrect;
RECT rect;
TRACE("(%p, %p, %p, %p, %d, %p, %d, %x, %p)\n", pDestSurface, pDestPalette, pDestRect, pSrcData,
SrcDataSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, "
"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)
return D3DERR_INVALIDCALL;
@ -897,136 +893,126 @@ cleanup_err:
return D3D_OK;
}
/************************************************************
* D3DXLoadSurfaceFromFile
*/
HRESULT WINAPI D3DXLoadSurfaceFromFileA(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
LPCSTR pSrcFile,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
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;
HRESULT hr;
int strlength;
TRACE("(%p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, debugstr_a(pSrcFile),
pSrcRect, dwFilter, Colorkey, pSrcInfo);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
"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));
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);
return hr;
}
HRESULT WINAPI D3DXLoadSurfaceFromFileW(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
LPCWSTR pSrcFile,
CONST RECT *pSrcRect,
DWORD Filter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
HRESULT WINAPI D3DXLoadSurfaceFromFileW(IDirect3DSurface9 *dst_surface,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, const WCHAR *src_file,
const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
{
UINT data_size;
void *data;
HRESULT hr;
DWORD dwSize;
LPVOID pBuffer;
TRACE("(%p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, debugstr_w(pSrcFile),
pSrcRect, Filter, Colorkey, pSrcInfo);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
"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(hr)) return D3DXERR_INVALIDDATA;
if (FAILED(map_view_of_file(src_file, &data, &data_size)))
return D3DXERR_INVALIDDATA;
hr = D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, Filter, Colorkey, pSrcInfo);
UnmapViewOfFile(pBuffer);
hr = D3DXLoadSurfaceFromFileInMemory(dst_surface, dst_palette, dst_rect,
data, data_size, src_rect, filter, color_key, src_info);
UnmapViewOfFile(data);
return hr;
}
/************************************************************
* D3DXLoadSurfaceFromResource
*/
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)
HRESULT WINAPI D3DXLoadSurfaceFromResourceA(IDirect3DSurface9 *dst_surface,
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)
{
HRSRC hResInfo;
TRACE("(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, hSrcModule,
debugstr_a(pResource), pSrcRect, dwFilter, Colorkey, pSrcInfo);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
"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) {
LPVOID pBuffer;
HRESULT hr;
DWORD dwSize;
if ((hResInfo = FindResourceA(src_module, resource, (const char *)RT_RCDATA)))
{
UINT data_size;
void *data;
hr = load_resource_into_memory(hSrcModule, hResInfo, &pBuffer, &dwSize);
if(FAILED(hr)) return D3DXERR_INVALIDDATA;
return D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
if (FAILED(load_resource_into_memory(src_module, hResInfo, &data, &data_size)))
return D3DXERR_INVALIDDATA;
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) {
FIXME("Implement loading bitmaps from resource type RT_BITMAP\n");
if ((hResInfo = FindResourceA(src_module, resource, (const char *)RT_BITMAP)))
{
FIXME("Implement loading bitmaps from resource type RT_BITMAP.\n");
return E_NOTIMPL;
}
return D3DXERR_INVALIDDATA;
}
HRESULT WINAPI D3DXLoadSurfaceFromResourceW(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
HMODULE hSrcModule,
LPCWSTR pResource,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey,
D3DXIMAGE_INFO *pSrcInfo)
HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, HMODULE src_module, const WCHAR *resource,
const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info)
{
HRSRC hResInfo;
TRACE("(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay\n", pDestSurface, pDestPalette, pDestRect, hSrcModule,
debugstr_w(pResource), pSrcRect, dwFilter, Colorkey, pSrcInfo);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
"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) {
LPVOID pBuffer;
HRESULT hr;
DWORD dwSize;
if ((hResInfo = FindResourceW(src_module, resource, (const WCHAR *)RT_RCDATA)))
{
UINT data_size;
void *data;
hr = load_resource_into_memory(hSrcModule, hResInfo, &pBuffer, &dwSize);
if(FAILED(hr)) return D3DXERR_INVALIDDATA;
return D3DXLoadSurfaceFromFileInMemory(pDestSurface, pDestPalette, pDestRect, pBuffer, dwSize, pSrcRect, dwFilter, Colorkey, pSrcInfo);
if (FAILED(load_resource_into_memory(src_module, hResInfo, &data, &data_size)))
return D3DXERR_INVALIDDATA;
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) {
FIXME("Implement loading bitmaps from resource type RT_BITMAP\n");
if ((hResInfo = FindResourceW(src_module, resource, (const WCHAR *)RT_BITMAP)))
{
FIXME("Implement loading bitmaps from resource type RT_BITMAP.\n");
return E_NOTIMPL;
}
return D3DXERR_INVALIDDATA;
}
@ -1543,38 +1529,38 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
* D3DXERR_INVALIDDATA, if one of the surfaces is not lockable
*
*/
HRESULT WINAPI D3DXLoadSurfaceFromSurface(LPDIRECT3DSURFACE9 pDestSurface,
CONST PALETTEENTRY *pDestPalette,
CONST RECT *pDestRect,
LPDIRECT3DSURFACE9 pSrcSurface,
CONST PALETTEENTRY *pSrcPalette,
CONST RECT *pSrcRect,
DWORD dwFilter,
D3DCOLOR Colorkey)
HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface,
const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface,
const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key)
{
RECT rect;
D3DLOCKED_RECT lock;
D3DSURFACE_DESC SrcDesc;
HRESULT hr;
TRACE("(%p, %p, %p, %p, %p, %p, %u, %#x): relay\n", pDestSurface, pDestPalette, pDestRect,
pSrcSurface, pSrcPalette, pSrcRect, dwFilter, Colorkey);
TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_surface %p, "
"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);
else rect = *pSrcRect;
if (!src_rect)
SetRect(&rect, 0, 0, SrcDesc.Width, SrcDesc.Height);
else
rect = *src_rect;
hr = IDirect3DSurface9_LockRect(pSrcSurface, &lock, NULL, D3DLOCK_READONLY);
if(FAILED(hr)) return D3DXERR_INVALIDDATA;
if (FAILED(IDirect3DSurface9_LockRect(src_surface, &lock, NULL, D3DLOCK_READONLY)))
return D3DXERR_INVALIDDATA;
hr = D3DXLoadSurfaceFromMemory(pDestSurface, pDestPalette, pDestRect,
lock.pBits, SrcDesc.Format, lock.Pitch,
pSrcPalette, &rect, dwFilter, Colorkey);
hr = D3DXLoadSurfaceFromMemory(dst_surface, dst_palette, dst_rect,
lock.pBits, SrcDesc.Format, lock.Pitch, src_palette, &rect, filter, color_key);
IDirect3DSurface9_UnlockRect(src_surface);
IDirect3DSurface9_UnlockRect(pSrcSurface);
return hr;
}