From 79572bb0f822df1ed5e0986a9805657afd413dfd Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 20 Mar 2024 23:39:55 +0800 Subject: [PATCH] [saco] Update CChatWindow constructor * Update `DoInitStuff()` * Add `CChatWindow::CreateFonts()` stub --- saco/chatwindow.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++- saco/chatwindow.h | 32 ++++++++++++++++++++++++- saco/main.cpp | 1 + 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/saco/chatwindow.cpp b/saco/chatwindow.cpp index c4cf2af..6d30942 100644 --- a/saco/chatwindow.cpp +++ b/saco/chatwindow.cpp @@ -1,7 +1,62 @@ #include "main.h" -CChatWindow::CChatWindow() +//---------------------------------------------------- + +CChatWindow::CChatWindow(IDirect3DDevice9 *pD3DDevice, CFontRender *pFontRender, CHAR *szChatLogFile) +{ + int x=0; + + m_pD3DDevice = pD3DDevice; + m_pFontRender = pFontRender; + field_8 = 2; + + // Create a sprite to use when drawing text + D3DXCreateSprite(pD3DDevice,&field_63A6); + D3DXCreateSprite(pD3DDevice,&field_63AA); + + m_dwChatTextColor = D3DCOLOR_ARGB(255,255,255,255); + m_dwChatInfoColor = D3DCOLOR_ARGB(255,136,170,98); + m_dwChatDebugColor = D3DCOLOR_ARGB(255,169,196,228); + + field_0 = 10; + field_C = 0; + + if(szChatLogFile && strlen(szChatLogFile)) + { + memset(&field_11[0],0,sizeof(field_11)); + strncpy(field_11,szChatLogFile,MAX_PATH); + + FILE *f = fopen(field_11, "w"); + if(f) + { + field_D = 1; + fclose(f); + } + } + + field_63BE = 0; + field_63BA = NULL; + field_63B6 = NULL; + field_63D2 = GetTickCount(); + field_63DE = 1; + field_11E = 0; + field_116 = 0; + field_11A = 0; + + CreateFonts(); +} + +//---------------------------------------------------- + +void CChatWindow::CreateFonts() +{ + + // TODO: CChatWindow::CreateFonts .text:100681D0 +} + +//---------------------------------------------------- + { // TODO: CChatWindow::CChatWindow() .text:100680F0 } diff --git a/saco/chatwindow.h b/saco/chatwindow.h index dc97312..5be5fee 100644 --- a/saco/chatwindow.h +++ b/saco/chatwindow.h @@ -4,7 +4,37 @@ class CChatWindow // size: 25578 { private: - char _gap0[25578]; + + int field_0; + char _gap4[4]; + int field_8; + char field_C; + int field_D; + char field_11[261]; + int field_116; + int field_11A; + int field_11E; + DWORD m_dwChatTextColor; + DWORD m_dwChatInfoColor; + DWORD m_dwChatDebugColor; + char _gap12E[4]; + char field_132[25200]; + CFontRender *m_pFontRender; + ID3DXSprite *field_63A6; + ID3DXSprite *field_63AA; + IDirect3DDevice9 *m_pD3DDevice; + int field_63B2; + ID3DXRenderToSurface *field_63B6; + IDirect3DTexture9* field_63BA; + int field_63BE; + D3DDISPLAYMODE field_63C2; + DWORD field_63D2; + int field_63D6; + int field_63DA; + int field_63DE; + char _gap63E2[8]; + + void CreateFonts(); public: CChatWindow(); diff --git a/saco/main.cpp b/saco/main.cpp index f12fd54..2eb86e3 100644 --- a/saco/main.cpp +++ b/saco/main.cpp @@ -330,6 +330,7 @@ void DoInitStuff() // Create instances of the chat and input classes. pDefaultFont = new CFontRender(pD3DDevice); + pChatWindow = new CChatWindow(pD3DDevice,pDefaultFont,szChatLogFile);