[PATCH v2 5/5] d3dx9: Remove a recursive call to ID3DXFont_DrawTextW when no rect is specified.

Sven Baars sbaars at codeweavers.com
Mon Mar 16 05:23:20 CDT 2020


Signed-off-by: Sven Baars <sbaars at codeweavers.com>
---
 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 8ea1f7913e..c590018894 100644
--- a/dlls/d3dx9_36/font.c
+++ b/dlls/d3dx9_36/font.c
@@ -679,17 +679,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;
-    }
 
     calcrect = textrect;
 
@@ -823,7 +814,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
             break;
     }
 
-    if (format & DT_CALCRECT)
+    if (format & DT_CALCRECT && rect)
     {
         *rect = calcrect;
 
-- 
2.24.0




More information about the wine-devel mailing list