metaforce/Runtime/Particle/CDecalManager.cpp

59 lines
1.5 KiB
C++
Raw Normal View History

2016-04-07 07:10:08 +00:00
#include "CDecalManager.hpp"
#include "CDecalDescription.hpp"
2016-08-04 22:24:28 +00:00
#include "CDecal.hpp"
#include "CStateManager.hpp"
#include "Graphics/CBooRenderer.hpp"
#include "GameGlobalObjects.hpp"
2016-04-07 07:10:08 +00:00
namespace urde
{
bool CDecalManager::m_PoolInitialized = false;
s32 CDecalManager::m_FreeIndex = 63;
float CDecalManager::m_DeltaTimeSinceLastDecalCreation = 0.f;
s32 CDecalManager::m_LastDecalCreatedIndex = -1;
2017-08-13 05:26:14 +00:00
CAssetId CDecalManager::m_LastDecalCreatedAssetId = -1;
2016-04-15 20:42:40 +00:00
rstl::reserved_vector<CDecalManager::SDecal, 64> CDecalManager::m_DecalPool;
rstl::reserved_vector<s32, 64> CDecalManager::m_ActiveIndexList;
2016-04-07 07:10:08 +00:00
void CDecalManager::Initialize()
{
if (m_PoolInitialized)
return;
m_DecalPool.clear();
m_DecalPool.resize(64);
m_FreeIndex = 63;
m_PoolInitialized = true;
m_DeltaTimeSinceLastDecalCreation = 0.f;
m_LastDecalCreatedIndex = -1;
m_LastDecalCreatedAssetId = -1;
}
void CDecalManager::Shutdown()
{
}
void CDecalManager::AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr)
{
for (s32 idx : m_ActiveIndexList)
{
CDecalManager::SDecal& decal = m_DecalPool[idx];
if (decal.x75_flags & 0x2 || mgr.GetParticleFlags())
{
const zeus::CVector3f& point = decal.x0_decal->xc_transform.origin;
zeus::CAABox aabb(point, point);
g_Renderer->AddDrawable(&*decal.x0_decal, point, aabb, 2,
IRenderer::EDrawableSorting::SortedCallback);
}
}
}
2017-03-24 05:30:16 +00:00
void CDecalManager::Update(float dt, CStateManager& mgr)
{
}
2016-04-07 07:10:08 +00:00
}