https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4f3d8e9fbf544f595c69a7...
commit 4f3d8e9fbf544f595c69a71ba6317de4245e5e09 Author: winesync ros-dev@reactos.org AuthorDate: Mon Sep 21 23:07:33 2020 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Thu Feb 4 16:37:06 2021 +0100
[WINESYNC] d3dx9: Switch character count to unsigned int in the DrawText implementation.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
wine commit id b5df43b9118074485a1f4a917b16d37bc068839d by Matteo Bruni mbruni@codeweavers.com --- dll/directx/wine/d3dx9_36/font.c | 16 ++++++++-------- sdk/tools/winesync/d3dx9.cfg | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c index 4546a261a49..35173956dc1 100644 --- a/dll/directx/wine/d3dx9_36/font.c +++ b/dll/directx/wine/d3dx9_36/font.c @@ -556,11 +556,11 @@ static void word_break(HDC hdc, const WCHAR *str, unsigned int *str_len, heap_free(sla); }
-static const WCHAR *read_line(HDC hdc, const WCHAR *str, int *count, +static const WCHAR *read_line(HDC hdc, const WCHAR *str, unsigned int *count, WCHAR *dest, unsigned int *dest_len, int width, DWORD format, SIZE *size) { + unsigned int orig_count = *count; unsigned int i = 0; - int orig_count = *count; int num_fit;
*dest_len = 0; @@ -604,25 +604,25 @@ static const WCHAR *read_line(HDC hdc, const WCHAR *str, int *count, }
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite, - const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color) + const WCHAR *string, INT in_count, RECT *rect, DWORD format, D3DCOLOR color) { struct d3dx_font *font = impl_from_ID3DXFont(iface); ID3DXSprite *target = sprite; - WCHAR *line; RECT textrect = {0}; int lh, x, y, width; + unsigned int count; int max_width = 0; + WCHAR *line; int ret = 0; SIZE size;
- TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x.\n", - iface, sprite, debugstr_wn(string, count), count, wine_dbgstr_rect(rect), format, color); + TRACE("iface %p, sprite %p, string %s, in_count %d, rect %s, format %#x, color 0x%08x.\n", + iface, sprite, debugstr_wn(string, in_count), in_count, wine_dbgstr_rect(rect), format, color);
if (!string) return 0;
- if (count < 0) - count = lstrlenW(string); + count = in_count < 0 ? lstrlenW(string) : in_count;
if (!count) return 0; diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg index 30c69c92f33..0767e5b37c3 100644 --- a/sdk/tools/winesync/d3dx9.cfg +++ b/sdk/tools/winesync/d3dx9.cfg @@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h: sdk/inc include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h: sdk/include/dxsdk/d3dx9of.h, include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h: sdk/include/dxsdk/d3dx9shape.h, include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h} -tags: {wine: 9bcb1f5195d1e65e0e7afb288d36fee716fe3a60} +tags: {wine: b5df43b9118074485a1f4a917b16d37bc068839d}