mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 19:43:37 +00:00
d3dx10/font: Add PreloadTextW().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
293484af60
commit
abbab131b8
|
@ -210,9 +210,33 @@ static HRESULT WINAPI d3dx_font_PreloadTextA(ID3DX10Font *iface, const char *str
|
|||
|
||||
static HRESULT WINAPI d3dx_font_PreloadTextW(ID3DX10Font *iface, const WCHAR *string, INT count)
|
||||
{
|
||||
FIXME("iface %p, string %s, count %d stub!\n", iface, debugstr_wn(string, count), count);
|
||||
struct d3dx_font *font = impl_from_ID3DX10Font(iface);
|
||||
WORD *indices;
|
||||
int i;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("iface %p, string %s, count %d.\n", iface, debugstr_wn(string, count), count);
|
||||
|
||||
if (!string && !count)
|
||||
return S_OK;
|
||||
|
||||
if (!string)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (count < 0)
|
||||
count = lstrlenW(string);
|
||||
|
||||
indices = heap_alloc(count * sizeof(*indices));
|
||||
if (!indices)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
GetGlyphIndicesW(font->hdc, string, count, indices, 0);
|
||||
|
||||
for (i = 0; i < count; ++i)
|
||||
ID3DX10Font_PreloadGlyphs(iface, indices[i], indices[i]);
|
||||
|
||||
heap_free(indices);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static INT WINAPI d3dx_font_DrawTextA(ID3DX10Font *iface, ID3DX10Sprite *sprite,
|
||||
|
|
|
@ -2263,32 +2263,23 @@ static void test_font(void)
|
|||
hr = ID3DX10Font_PreloadTextA(font, NULL, 1);
|
||||
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextA(font, "test", -1);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextA(font, "", 0);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextA(font, "", -1);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = ID3DX10Font_PreloadTextW(font, NULL, -1);
|
||||
todo_wine
|
||||
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextW(font, NULL, 0);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextW(font, NULL, 1);
|
||||
todo_wine
|
||||
ok(hr == D3DERR_INVALIDCALL, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextW(font, testW, -1);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextW(font, L"", 0);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = ID3DX10Font_PreloadTextW(font, L"", -1);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
ID3DX10Font_Release(font);
|
||||
|
|
Loading…
Reference in a new issue