Files
Client/Engine/Zalla3D Base Class/Pool.cpp
LGram16 e067522598 Initial commit: ROW Client source code
Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 16:24:34 +09:00

102 lines
2.0 KiB
C++

#include ".\pool.h"
#include "./PoolMgr.h"
#include "./Z3DByteDataObj.h"
#include "./NTexture.h"
#include "./ResourceMgr.h"
#include "../zalla3d scene class/NMesh.h"
#include "../zalla3d scene class/HouseObjectScene.h"
#include "../zalla3d scene class/HouseObject.h"
#include "../zalla3d scene class/ObjectScene.h"
#include "../zalla3d scene class/OctreeScene.h"
#include "../zalla3d scene class/Octree.h"
#include "GMMemory.h"
namespace CROSSM {
CPool::CPool(void)
{
}
CPool::~CPool(void)
{
ReleaseAllData();
}
void CPool::AddPool(int iType,IPoolMgr *pMgr)
{
POOLTABLEITER itr = m_PoolMap.find(iType);
if(itr == m_PoolMap.end())
{
m_PoolMap.insert(POOLTABLEOBJ(iType,pMgr));
}
}
void CPool::Init()
{
// AddPool(POOL_BYTEDATAOBJ,new CPoolMgr<CZ3DByteDataObj>);
// AddPool(POOL_DELRESOURCEINFOOBJ,new CPoolMgr<CDelResourceInfo>);
// AddPool(POOL_RESOURCEMGROBJ,new CPoolMgr<CResourceMgrObj>);
// AddPool(POOL_HOUSEOBJSCENE,new CPoolMgr<CHouseObjectScene>);
// AddPool(POOL_HOUSEOBJ,new CPoolMgr<CHouseObject>);
// AddPool(POOL_OBJECTSCENE,new CPoolMgr<CObjectScene>);
// AddPool(POOL_OCTREEOBJ,new CPoolMgr<COctree>);
// AddPool(POOL_POLYNODE,new CPoolMgr<PolyNode>);
AddPool(RESOURCE_TEXTURE,new CPoolMgr<CNTexture>);
AddPool(RESOURCE_MESH,new CPoolMgr<CNMesh>);
AddPool(RESOURCE_OCTREESCENE,new CPoolMgr<COctreeScene>);
}
void CPool::Release()
{
}
void CPool::ReleaseAllData()
{
for(POOLTABLEITER itr = m_PoolMap.begin(); itr != m_PoolMap.end();)
{
if(itr->second != NULL)
{
itr->second->ReleaseAll();
SafeDelete(itr->second);
itr->second = NULL;
}
itr++;
}
m_PoolMap.clear();
}
void CPool::ReleaseObj(int iType,void *pObj)
{
if(pObj)
{
POOLTABLEITER itr = m_PoolMap.find(iType);
if(itr != m_PoolMap.end())
{
if(itr->second)
{
itr->second->ReleaseObj(pObj);
}
}
}
}
void *CPool::GetObj(int iType)
{
POOLTABLEITER itr = m_PoolMap.find(iType);
if(itr != m_PoolMap.end())
{
if(itr->second)
{
return itr->second->GetObj();
}
}
return NULL;
}
}