From d17a278bcdb7f3aa8e7a9539cb11bf069daa57df Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:47:43 +0800 Subject: [PATCH] [saco] Fix compilation errors --- saco/chatwindow.cpp | 4 ---- saco/cmdwindow.cpp | 6 ------ saco/fontrender.cpp | 28 ++++++++++++++++++++++++++-- saco/fontrender.h | 9 ++++++++- saco/game/audio.cpp | 2 +- saco/game/common.h | 1 + saco/game/game.h | 18 ++++++++++-------- saco/main.h | 3 +++ saco/saco.vcproj | 27 +++++++++++++++++++++++++-- 9 files changed, 74 insertions(+), 24 deletions(-) diff --git a/saco/chatwindow.cpp b/saco/chatwindow.cpp index 6d30942..f282169 100644 --- a/saco/chatwindow.cpp +++ b/saco/chatwindow.cpp @@ -57,10 +57,6 @@ void CChatWindow::CreateFonts() //---------------------------------------------------- -{ - // TODO: CChatWindow::CChatWindow() .text:100680F0 -} - void CChatWindow::AddDebugMessage(CHAR * szFormat, ...) { // TODO: CChatWindow::AddDebugMessage .text:100680F0 diff --git a/saco/cmdwindow.cpp b/saco/cmdwindow.cpp index 9a2ec5c..1cf7b62 100644 --- a/saco/cmdwindow.cpp +++ b/saco/cmdwindow.cpp @@ -19,12 +19,6 @@ CCmdWindow::CCmdWindow(IDirect3DDevice9 *pD3DDevice) //---------------------------------------------------- -{ - // TODO: CCmdWindow::CCmdWindow() .text:100693D0 -} - -//---------------------------------------------------- - void CCmdWindow::AddDefaultCmdProc(CMDPROC cmdDefault) { m_pDefaultCmd = cmdDefault; diff --git a/saco/fontrender.cpp b/saco/fontrender.cpp index 99b3d6b..cdfee3d 100644 --- a/saco/fontrender.cpp +++ b/saco/fontrender.cpp @@ -1,7 +1,31 @@ -#include "fontrender.h" +#include "main.h" -CFontRender::CFontRender() +CFontRender::CFontRender(IDirect3DDevice9* pD3DDevice) { // TODO: CFontRender::CFontRender() .text:1006BAF0 } + +void CFontRender::DeleteDeviceObjects() +{ + // TODO: CFontRender::DeleteDeviceObjects() .text:1006B180 +} + +void CFontRender::RestoreDeviceObjects() +{ + // TODO: CFontRender::RestoreDeviceObjects() .text:1006B1C0 +} + +SIZE CFontRender::MeasureText(char * szString, DWORD dwFormat) +{ + SIZE size = {0,0}; + + // TODO: CFontRender::MeasureText .text:1006B200 + + return size; +} + +void CFontRender::RenderText(ID3DXSprite * pSprite, char * sz, RECT rect, DWORD dwColor, BOOL bShadowed) +{ + // TODO: CFontRender::RenderText .text:1006B360 +} diff --git a/saco/fontrender.h b/saco/fontrender.h index 82f1c2d..33294d7 100644 --- a/saco/fontrender.h +++ b/saco/fontrender.h @@ -7,5 +7,12 @@ private: char _gap0[40]; public: - CFontRender(); + CFontRender(IDirect3DDevice9* pD3DDevice); + + void DeleteDeviceObjects(); + void RestoreDeviceObjects(); + + SIZE MeasureText(char * szString, DWORD dwFormat = 0); + + void RenderText(ID3DXSprite * pSprite, char * sz, RECT rect, DWORD dwColor, BOOL bShadowed = TRUE); }; diff --git a/saco/game/audio.cpp b/saco/game/audio.cpp index 5c69921..f1cd01e 100644 --- a/saco/game/audio.cpp +++ b/saco/game/audio.cpp @@ -1,5 +1,5 @@ -#include "audio.h" +#include "game.h" //----------------------------------------------------------- diff --git a/saco/game/common.h b/saco/game/common.h index 3a07a3b..3e0cb31 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -2,6 +2,7 @@ #pragma once #include +#include #define MAX_PLAYERS 1004 #define MAX_ACTORS 1000 diff --git a/saco/game/game.h b/saco/game/game.h index 88bba26..5320a56 100644 --- a/saco/game/game.h +++ b/saco/game/game.h @@ -35,6 +35,8 @@ private: public: + void StartGame(); + void InitGame(); BOOL IsGameLoaded(); void RequestModel(int iModelID, int iLoadingStream = 2); @@ -57,9 +59,7 @@ public: void ReleaseAnimation(char *szAnimFile); void ToggleRadar(int iToggle); void DisplayGameText(char *szStr,int iTime,int iSize); - void SetGravity(float fGravity); - void SetWantedLevel(BYTE byteLevel); void SetGameTextCount(WORD wCount); void DrawGangZone(float* fPos, DWORD dwColor); @@ -81,17 +81,21 @@ public: HWND GetMainWindowHwnd() { return *(HWND *)ADDR_HWND; }; - void StartGame(); - void InitGame(); + void RestartEverything(); + + //----------------------------------------------------------- + CPlayerPed *FindPlayerPed() { if(m_pGamePlayer==NULL) m_pGamePlayer = new CPlayerPed(); return m_pGamePlayer; }; - DWORD GetWeaponInfo(int iWeapon, int iUnk); - const PCHAR GetWeaponName(int iWeaponID); + int GetScreenWidth() { return *(int*)0xC17044; }; + int GetScreenHeight() { return *(int*)0xC17048; }; + + DWORD GetWeaponInfo(int iWeapon, int iUnk); CGame(); @@ -109,8 +113,6 @@ public: void sub_100A03E0(); void sub_100A0400(); - - void sub_100A05D0(); void sub_100A06F0(); diff --git a/saco/main.h b/saco/main.h index aac346c..5d98fcb 100644 --- a/saco/main.h +++ b/saco/main.h @@ -5,6 +5,8 @@ #include #include +#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } } + #define MAX_SETTINGS_STRING 256 #define GTASA_VERSION_UNKNOWN 0 @@ -31,6 +33,7 @@ typedef struct _GAME_SETTINGS { #include "../raknet/RakClientInterface.h" #include "../raknet/RakNetworkFactory.h" +#include "../raknet/PacketEnumerations.h" #include "../raknet/SAMPRPC.h" #include "../raknet/GetTime.h" diff --git a/saco/saco.vcproj b/saco/saco.vcproj index c0c079a..166a67d 100644 --- a/saco/saco.vcproj +++ b/saco/saco.vcproj @@ -33,9 +33,10 @@ Name="VCCustomBuildTool"/> + + + + + + + + + + + + + +