[saco] Implement CMenuPool ctor

This commit is contained in:
RD42
2024-02-12 20:22:51 +08:00
parent a6b3920780
commit 56e0bf3910
7 changed files with 46 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#define MAX_ACTORS 1000
#define MAX_VEHICLES 2000
#define MAX_OBJECTS 1000
#define MAX_MENUS 128
#define MAX_LABELS 2048
#define PLAYER_PED_SLOTS 210

View File

@ -34,6 +34,7 @@ typedef struct _GAME_SETTINGS {
#include "net/vehiclepool.h"
#include "net/pickuppool.h"
#include "net/objectpool.h"
#include "net/menupool.h"
#include "net/labelpool.h"
#include "net/netgame.h"
#include "net/scriptrpc.h"

17
saco/net/menupool.cpp Normal file
View File

@ -0,0 +1,17 @@
#include "../main.h"
//----------------------------------------------------
CMenuPool::CMenuPool()
{
// loop through and initialize all net players to null and slot states to false
for (BYTE byteMenuID = 0; byteMenuID < MAX_MENUS; byteMenuID++)
{
field_200[byteMenuID] = 0;
field_0[byteMenuID] = 0;
}
field_400 = -128;
}
//----------------------------------------------------

18
saco/net/menupool.h Normal file
View File

@ -0,0 +1,18 @@
#pragma once
//----------------------------------------------------
class CMenuPool
{
private:
int field_0[MAX_MENUS];
int field_200[MAX_MENUS];
char field_400;
char field_401;
public:
CMenuPool();
};
//----------------------------------------------------

View File

@ -34,6 +34,7 @@ void CNetGame::InitPools()
m_pPools = (NETGAME_POOLS *)calloc(1, sizeof(NETGAME_POOLS));
m_pPools->pObjectPool = new CObjectPool();
m_pPools->pMenuPool = new CMenuPool();
m_pPools->pLabelPool = new CLabelPool();
m_pPools->pPlayerPool = new CPlayerPool();
m_pPools->pVehiclePool = new CVehiclePool();

View File

@ -33,7 +33,8 @@ typedef struct _NETGAME_POOLS {
CActorPool *pActorPool;
char _gap0[4];
CLabelPool *pLabelPool;
char _gap1[8];
char _gap1[4];
CMenuPool *pMenuPool;
} NETGAME_POOLS;
class CNetGame // size: 994

View File

@ -258,6 +258,12 @@
<File
RelativePath=".\net\labelpool.h">
</File>
<File
RelativePath=".\net\menupool.cpp">
</File>
<File
RelativePath=".\net\menupool.h">
</File>
<File
RelativePath=".\net\netgame.cpp">
</File>