From 05843d47707a8224a1f8470337cb24173d1eee29 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Fri, 5 Jun 2009 13:26:11 +0200 Subject: [PATCH] d3dx9: Implement ID3DXFont_GetDesc. --- dlls/d3dx9_36/d3dx9_36_private.h | 1 + dlls/d3dx9_36/font.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index 5891794e4b0..5d3d329f3e2 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -42,6 +42,7 @@ typedef struct ID3DXFontImpl /* ID3DXFont fields */ IDirect3DDevice9 *device; + D3DXFONT_DESCW desc; } ID3DXFontImpl; diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c index e7f770cc2f1..1de063469ad 100644 --- a/dlls/d3dx9_36/font.c +++ b/dlls/d3dx9_36/font.c @@ -76,14 +76,23 @@ static HRESULT WINAPI ID3DXFontImpl_GetDevice(LPD3DXFONT iface, LPDIRECT3DDEVICE static HRESULT WINAPI ID3DXFontImpl_GetDescA(LPD3DXFONT iface, D3DXFONT_DESCA *desc) { ID3DXFontImpl *This=(ID3DXFontImpl*)iface; - FIXME("(%p): stub\n", This); + TRACE("(%p)\n", This); + + if( !desc ) return D3DERR_INVALIDCALL; + memcpy(desc, &This->desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName)); + WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL); + return D3D_OK; } static HRESULT WINAPI ID3DXFontImpl_GetDescW(LPD3DXFONT iface, D3DXFONT_DESCW *desc) { ID3DXFontImpl *This=(ID3DXFontImpl*)iface; - FIXME("(%p): stub\n", This); + TRACE("(%p)\n", This); + + if( !desc ) return D3DERR_INVALIDCALL; + *desc = This->desc; + return D3D_OK; } @@ -289,6 +298,7 @@ HRESULT WINAPI D3DXCreateFontIndirectW(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_ object->lpVtbl=&D3DXFont_Vtbl; object->ref=1; object->device=device; + object->desc=*desc; IDirect3DDevice9_AddRef(device); *font=(LPD3DXFONT)object;