[saco] Implement/match CFontRender::MeasureText2(...)

This commit is contained in:
RD42 2024-07-23 18:56:47 +08:00
parent 05250c0aa2
commit 0a6d658266
2 changed files with 17 additions and 0 deletions

View File

@ -119,6 +119,22 @@ SIZE CFontRender::MeasureText(char * szString, DWORD dwFormat)
return ret;
}
SIZE CFontRender::MeasureText2(char * szString, DWORD dwFormat)
{
RECT rect;
SIZE ret = {0, 0};
if(strlen(szString) > 100000) return ret;
strcpy(field_1C,szString);
RemoveColorEmbedsFromString(field_1C);
field_4->DrawTextA(NULL,field_1C,-1,&rect,dwFormat|DT_CALCRECT,0xFF000000);
ret.cx = rect.right - rect.left;
ret.cy = rect.bottom - rect.top;
return ret;
}
void CFontRender::RenderText(ID3DXSprite * pSprite, char * sz, RECT rect, DWORD dwColor, BOOL bShadowed)
{
// TODO: CFontRender::RenderText .text:1006B360

View File

@ -25,6 +25,7 @@ public:
void RestoreDeviceObjects();
SIZE MeasureText(char * szString, DWORD dwFormat = DT_LEFT);
SIZE MeasureText2(char * szString, DWORD dwFormat = DT_LEFT);
void RenderText(ID3DXSprite * pSprite, char * sz, RECT rect, DWORD dwColor, BOOL bShadowed = TRUE);
};