2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CPARTICLEDATABASE_HPP__
|
|
|
|
#define __URDE_CPARTICLEDATABASE_HPP__
|
2016-04-12 22:28:08 +00:00
|
|
|
|
2016-04-16 21:49:47 +00:00
|
|
|
#include "CCharacterInfo.hpp"
|
|
|
|
#include "CParticleGenInfo.hpp"
|
2016-09-04 02:27:35 +00:00
|
|
|
#include "zeus/CFrustum.hpp"
|
2017-03-01 06:02:54 +00:00
|
|
|
#include "CToken.hpp"
|
2017-06-10 06:13:16 +00:00
|
|
|
#include "Particle/CGenDescription.hpp"
|
|
|
|
#include "Particle/CSwooshDescription.hpp"
|
|
|
|
#include "Particle/CElectricDescription.hpp"
|
2016-04-16 21:49:47 +00:00
|
|
|
#include <map>
|
|
|
|
|
2016-04-12 22:28:08 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
2016-09-04 02:27:35 +00:00
|
|
|
class CPoseAsTransforms;
|
|
|
|
class CCharLayoutInfo;
|
2016-04-12 22:28:08 +00:00
|
|
|
|
|
|
|
class CParticleDatabase
|
|
|
|
{
|
2017-03-01 06:02:54 +00:00
|
|
|
std::map<ResId, std::shared_ptr<TLockedToken<CGenDescription>>> x0_particleDescs;
|
|
|
|
std::map<ResId, std::shared_ptr<TLockedToken<CSwooshDescription>>> x14_swooshDescs;
|
|
|
|
std::map<ResId, std::shared_ptr<TLockedToken<CElectricDescription>>> x28_electricDescs;
|
2017-06-03 06:03:07 +00:00
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> x3c_rendererDrawLoop;
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> x50_firstDrawLoop;
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> x64_lastDrawLoop;
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> x78_rendererDraw;
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> x8c_firstDraw;
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>> xa0_lastDraw;
|
|
|
|
bool xb4_24_active : 1;
|
|
|
|
bool xb4_25_drawingEnds : 1;
|
2016-11-20 21:53:15 +00:00
|
|
|
|
2017-06-03 06:03:07 +00:00
|
|
|
static void SetModulationColorAllActiveEffectsForParticleDB(const zeus::CColor& color,
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map);
|
|
|
|
static void SuspendAllActiveEffectsForParticleDB(CStateManager& mgr,
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map);
|
|
|
|
static void DeleteAllLightsForParticleDB(CStateManager& mgr,
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map);
|
|
|
|
static void RenderParticleGenMap(const std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map);
|
|
|
|
static void RenderParticleGenMapMasked(const std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map,
|
|
|
|
int mask, int target);
|
|
|
|
static void AddToRendererClippedParticleGenMap(const std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map,
|
|
|
|
const zeus::CFrustum& frustum);
|
|
|
|
static void AddToRendererClippedParticleGenMapMasked(const std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map,
|
|
|
|
const zeus::CFrustum& frustum, int mask, int target);
|
|
|
|
static void UpdateParticleGenDB(float dt, const CPoseAsTransforms& pose, const CCharLayoutInfo& charInfo,
|
|
|
|
const zeus::CTransform& xf, const zeus::CVector3f& vec, CStateManager& stateMgr,
|
|
|
|
std::map<std::string, std::unique_ptr<CParticleGenInfo>>& map, bool deleteIfDone);
|
2016-04-16 21:49:47 +00:00
|
|
|
public:
|
2017-06-03 06:03:07 +00:00
|
|
|
CParticleDatabase();
|
2016-04-16 21:49:47 +00:00
|
|
|
void CacheParticleDesc(const CCharacterInfo::CParticleResData& desc);
|
|
|
|
void SetModulationColorAllActiveEffects(const zeus::CColor& color);
|
2016-08-21 20:39:18 +00:00
|
|
|
void SuspendAllActiveEffects(CStateManager& stateMgr);
|
2017-06-03 06:03:07 +00:00
|
|
|
void DeleteAllLights(CStateManager& stateMgr);
|
2016-11-20 21:53:15 +00:00
|
|
|
void Update(float dt, const CPoseAsTransforms& pose, const CCharLayoutInfo& charInfo, const zeus::CTransform& xf,
|
2017-06-03 06:03:07 +00:00
|
|
|
const zeus::CVector3f& scale, CStateManager& stateMgr);
|
|
|
|
void RenderSystemsToBeDrawnLastMasked(int mask, int target) const;
|
|
|
|
void RenderSystemsToBeDrawnLast() const;
|
|
|
|
void RenderSystemsToBeDrawnFirstMasked(int mask, int target) const;
|
|
|
|
void RenderSystemsToBeDrawnFirst() const;
|
|
|
|
void AddToRendererClippedMasked(const zeus::CFrustum& frustum, int mask, int target) const;
|
|
|
|
void AddToRendererClipped(const zeus::CFrustum& frustum) const;
|
|
|
|
CParticleGenInfo* GetParticleEffect(const std::string& name) const;
|
|
|
|
void SetParticleEffectState(const std::string& name, bool active, CStateManager& mgr);
|
|
|
|
void SetCEXTValue(const std::string& name, int idx, float value);
|
|
|
|
void AddAuxiliaryParticleEffect(const std::string& name, int flags, const CAuxiliaryParticleData& data,
|
2017-06-04 01:01:09 +00:00
|
|
|
const zeus::CVector3f& scale, CStateManager& mgr, TAreaId aid, int lightId);
|
2017-06-03 06:03:07 +00:00
|
|
|
void AddParticleEffect(const std::string& name, int flags, const CParticleData& data,
|
2017-06-04 01:01:09 +00:00
|
|
|
const zeus::CVector3f& scale, CStateManager& mgr, TAreaId aid, bool oneShot, int lightId);
|
2017-06-03 06:03:07 +00:00
|
|
|
void InsertParticleGen(bool oneShot, int flags, const std::string& name,
|
|
|
|
std::unique_ptr<CParticleGenInfo>&& gen);
|
2016-04-12 22:28:08 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CPARTICLEDATABASE_HPP__
|