metaforce/Runtime/Particle/CParticleGlobals.hpp

55 lines
1.4 KiB
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CPARTICLEGLOBALS_HPP__
#define __PSHAG_CPARTICLEGLOBALS_HPP__
2016-02-05 08:34:14 +00:00
2016-03-04 23:04:53 +00:00
#include "zeus/CVector3f.hpp"
#include "zeus/CColor.hpp"
2016-02-14 07:38:01 +00:00
#include "RetroTypes.hpp"
2016-02-06 07:31:53 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2016-02-05 08:34:14 +00:00
{
class CElementGen;
2016-02-05 08:34:14 +00:00
class CParticleGlobals
{
public:
2016-02-09 22:52:33 +00:00
static int g_EmitterTime;
static float g_EmitterTimeReal;
2016-02-05 08:34:14 +00:00
static void SetEmitterTime(int frame)
{
2016-02-09 22:52:33 +00:00
g_EmitterTime = frame;
g_EmitterTimeReal = frame;
2016-02-05 08:34:14 +00:00
}
2016-02-09 22:52:33 +00:00
static int g_ParticleLifetime;
static float g_ParticleLifetimeReal;
2016-02-05 08:34:14 +00:00
static void SetParticleLifetime(int frame)
{
2016-02-09 22:52:33 +00:00
g_ParticleLifetime = frame;
g_ParticleLifetimeReal = frame;
2016-02-05 08:34:14 +00:00
}
2016-02-09 22:52:33 +00:00
static int g_ParticleLifetimePercentage;
static float g_ParticleLifetimePercentageReal;
static float g_ParticleLifetimePercentageRemainder;
2016-02-05 08:34:14 +00:00
static void UpdateParticleLifetimeTweenValues(int frame)
{
2016-02-09 22:52:33 +00:00
float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f;
g_ParticleLifetimePercentageReal = 100.0f * frame / lt;
g_ParticleLifetimePercentage = g_ParticleLifetimePercentageReal;
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
2016-02-05 08:34:14 +00:00
}
2016-02-06 07:31:53 +00:00
static float g_papValues[8];
2016-02-06 07:31:53 +00:00
2016-02-14 07:38:01 +00:00
struct SParticleSystem
{
FourCC x0_type;
CElementGen* x4_system;
2016-02-14 07:38:01 +00:00
};
static SParticleSystem* g_currentParticleSystem;
2016-02-05 08:34:14 +00:00
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CPARTICLEGLOBALS_HPP__