[saco] Implement CLabelPool ctor

This commit is contained in:
RD42 2024-02-12 20:16:37 +08:00
parent 864ab50d1e
commit 2da4d86441
7 changed files with 40 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#define MAX_ACTORS 1000
#define MAX_VEHICLES 2000
#define MAX_OBJECTS 1000
#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/labelpool.h"
#include "net/netgame.h"
#include "net/scriptrpc.h"

11
saco/net/labelpool.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "../main.h"
CLabelPool::CLabelPool()
{
for(WORD wLabel = 0; wLabel < MAX_LABELS; wLabel++)
{
memset(&field_0[wLabel], 0, sizeof(struc_92));
field_E800[wLabel] = 0;
}
}

17
saco/net/labelpool.h Normal file
View File

@ -0,0 +1,17 @@
#pragma once
struct struc_92
{
char _gap[29];
};
class CLabelPool
{
private:
struc_92 field_0[MAX_LABELS];
int field_E800[MAX_LABELS];
public:
CLabelPool();
};

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->pLabelPool = new CLabelPool();
m_pPools->pPlayerPool = new CPlayerPool();
m_pPools->pVehiclePool = new CVehiclePool();
m_pPools->pPickupPool = new CPickupPool();

View File

@ -31,7 +31,9 @@ typedef struct _NETGAME_POOLS {
CPickupPool *pPickupPool;
CObjectPool *pObjectPool;
CActorPool *pActorPool;
char _gap0[16];
char _gap0[4];
CLabelPool *pLabelPool;
char _gap1[8];
} NETGAME_POOLS;
class CNetGame // size: 994

View File

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