Sven Baars : d3dx9: Remove a recursive call to ID3DXFont_DrawTextW when no rect is specified.
Alexandre Julliard
julliard at winehq.org
Tue Mar 24 15:28:17 CDT 2020
Module: wine
Branch: master
Commit: 9796bdc966a89cd31829f3a094bb37ec71e21871
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9796bdc966a89cd31829f3a094bb37ec71e21871
Author: Sven Baars <sbaars at codeweavers.com>
Date: Tue Mar 24 14:05:14 2020 +0100
d3dx9: Remove a recursive call to ID3DXFont_DrawTextW when no rect is specified.
Signed-off-by: Sven Baars <sbaars at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3dx9_36/font.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
index 3645903367..54b1574bb1 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -629,17 +629,8 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
if (format & DT_SINGLELINE)
format &= ~DT_WORDBREAK;
- if (!rect)
- {
- y = ID3DXFont_DrawTextW(iface, NULL, string, count, &textrect, format | DT_CALCRECT, 0);
-
- if (format & DT_CALCRECT)
- return y;
- }
- else
- {
+ if (rect)
textrect = *rect;
- }
x = textrect.left;
y = textrect.top;
@@ -716,7 +707,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
break;
}
- if (format & DT_CALCRECT)
+ if (format & DT_CALCRECT && rect)
{
*rect = textrect;
More information about the wine-cvs
mailing list