[server] Add CTextDrawPool ctor/dtor

This commit is contained in:
RD42 2023-11-25 23:10:24 +08:00
parent 98a560e360
commit ce2fc48592
3 changed files with 40 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#define MAX_PLAYERS 1000
#define MAX_VEHICLES 2000
#define MAX_TEXT_DRAWS 2048
#define DEFAULT_MAX_PLAYERS 50
#define DEFAULT_LISTEN_PORT 8192

View File

@ -0,0 +1,30 @@
#include "main.h"
CTextDrawPool::CTextDrawPool()
{
for (WORD wText = 0; wText < MAX_TEXT_DRAWS; wText++)
{
field_0[wText] = 0;
field_2000[wText] = 0;
field_4000[wText] = 0;
}
}
CTextDrawPool::~CTextDrawPool()
{
for (WORD wText = 0; wText < MAX_TEXT_DRAWS; wText++)
{
if(field_2000[wText])
{
free(field_2000[wText]);
field_2000[wText] = NULL;
}
if(field_4000[wText])
{
free(field_4000[wText]);
field_4000[wText] = NULL;
}
}
}

View File

@ -5,7 +5,15 @@
class CTextDrawPool // size: WL 2072576
{
private:
char _gap0[2072576];
int field_0[2048];
int field_2000[2048];
int field_4000[2048];
char gap6000[2048000];
public:
CTextDrawPool();
~CTextDrawPool();
};
#endif