// *** OpenGTA3 ***
// object pools

#pragma pack(push,1)
class CPool {
public:
	CPool (int capacity, int blockSize);
	~CPool ();

	BYTE *	allocate ();
	void	release (BYTE * ptr);
	WORD	indexOf (BYTE * object);
	BYTE *	at (int index);

	BYTE *	objects;
	BYTE *	flags;
	int		size;
	int		top;
	int		objectSize;	// NOTE: в оригинале здесь было поле initialized
};
#pragma pack(pop)



extern void allocatePools ();
extern void shutdownPools ();
extern void initTxdPool (); // >> 731F20 (XREF: createWorld)

extern CPool ** ptrNodeSinglePool;
extern CPool ** ptrNodeDoublePool;
extern CPool ** entryInfoNodePool;
extern CPool ** pedPool;
extern CPool ** vehiclePool;
extern CPool ** buildingPool;
extern CPool ** objectPool;
extern CPool ** dummyPool;
extern CPool ** colModelPool;
extern CPool ** taskPool;
extern CPool ** eventPool;
extern CPool ** pointRoutePool;
extern CPool ** patrolRoutePool;
extern CPool ** nodeRoutePool;
extern CPool ** taskAllocatorPool;
extern CPool ** pedIntelligencePool;
extern CPool ** pedAttractorPool;

extern CPool ** envMapPipeMatDataPool;
extern CPool ** envMapPipeAtmDataPool;
extern CPool ** specMapPipeMatDataPool;

extern CPool ** txdPool;

extern CPool ** stuntJumpPool;

extern CPool ** vehicleStructPool;
