From 0ba6070b59471368210fc8e83e4629a14906e078 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sun, 2 Aug 2026 14:14:59 +0700 Subject: [PATCH] [saco] Implement/match `ID3DXFontHook::DrawTextA` --- saco/d3dhook/ID3DXFontHook.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/saco/d3dhook/ID3DXFontHook.cpp b/saco/d3dhook/ID3DXFontHook.cpp index 5ce2706..e43a539 100644 --- a/saco/d3dhook/ID3DXFontHook.cpp +++ b/saco/d3dhook/ID3DXFontHook.cpp @@ -2,9 +2,36 @@ #include "ID3DXFontHook.h" #include "../main.h" +int dword_10136EA0; +DWORD dword_10136E90; +int dword_10136EA4; +char *dword_10140AEC; +char *dword_10140AF0; +WCHAR WideCharStr[20000]; +int off_10102BF0; + +void sub_100739A0(char *lpMultiByteStr, WCHAR *lpWideCharStr, int cchWideChar); +void sub_100B60C0(char *lpString); + INT __stdcall ID3DXFontHook::DrawTextA(LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) { - // TODO: ID3DXFontHook::DrawTextA + if(pSprite) + { + dword_10136EA0 = (int)pSprite; + dword_10136E90 = Color; + dword_10136EA4 = 0; + + if(strlen(pString) > 0x186A0) + return 0; + + strcpy(dword_10140AEC, pString); + strcpy(dword_10140AF0, pString); + + sub_100739A0(dword_10140AEC, WideCharStr, 20000); + sub_100B60C0(dword_10140AF0); + + return m_pD3DFont->DrawTextA((LPD3DXSPRITE)&off_10102BF0, dword_10140AF0, strlen(dword_10140AF0), pRect, Format, Color); + } return m_pD3DFont->DrawTextA(pSprite, pString, Count, pRect, Format, Color); }