mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 13:07:42 +00:00
New code style refactor
This commit is contained in:
@@ -7,80 +7,69 @@
|
||||
#include "RetroTypes.hpp"
|
||||
#include <array>
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
class CElementGen;
|
||||
class CParticleGlobals
|
||||
{
|
||||
class CParticleGlobals {
|
||||
public:
|
||||
static int g_EmitterTime;
|
||||
static float g_EmitterTimeReal;
|
||||
static void SetEmitterTime(int frame)
|
||||
{
|
||||
g_EmitterTime = frame;
|
||||
g_EmitterTimeReal = frame;
|
||||
}
|
||||
static int g_EmitterTime;
|
||||
static float g_EmitterTimeReal;
|
||||
static void SetEmitterTime(int frame) {
|
||||
g_EmitterTime = frame;
|
||||
g_EmitterTimeReal = frame;
|
||||
}
|
||||
|
||||
static int g_ParticleLifetime;
|
||||
static float g_ParticleLifetimeReal;
|
||||
static void SetParticleLifetime(int frame)
|
||||
{
|
||||
g_ParticleLifetime = frame;
|
||||
g_ParticleLifetimeReal = frame;
|
||||
}
|
||||
static int g_ParticleLifetime;
|
||||
static float g_ParticleLifetimeReal;
|
||||
static void SetParticleLifetime(int frame) {
|
||||
g_ParticleLifetime = frame;
|
||||
g_ParticleLifetimeReal = frame;
|
||||
}
|
||||
|
||||
static int g_ParticleLifetimePercentage;
|
||||
static float g_ParticleLifetimePercentageReal;
|
||||
static float g_ParticleLifetimePercentageRemainder;
|
||||
static void UpdateParticleLifetimeTweenValues(int frame)
|
||||
{
|
||||
float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f;
|
||||
g_ParticleLifetimePercentageReal = 100.0f * frame / lt;
|
||||
g_ParticleLifetimePercentage = int(g_ParticleLifetimePercentageReal);
|
||||
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
|
||||
g_ParticleLifetimePercentage = zeus::clamp(0, g_ParticleLifetimePercentage, 100);
|
||||
}
|
||||
static int g_ParticleLifetimePercentage;
|
||||
static float g_ParticleLifetimePercentageReal;
|
||||
static float g_ParticleLifetimePercentageRemainder;
|
||||
static void UpdateParticleLifetimeTweenValues(int frame) {
|
||||
float lt = g_ParticleLifetime != 0.0f ? g_ParticleLifetime : 1.0f;
|
||||
g_ParticleLifetimePercentageReal = 100.0f * frame / lt;
|
||||
g_ParticleLifetimePercentage = int(g_ParticleLifetimePercentageReal);
|
||||
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
|
||||
g_ParticleLifetimePercentage = zeus::clamp(0, g_ParticleLifetimePercentage, 100);
|
||||
}
|
||||
|
||||
static const std::array<float, 8>* g_particleAccessParameters;
|
||||
static const std::array<float, 8>* g_particleAccessParameters;
|
||||
|
||||
struct SParticleSystem
|
||||
{
|
||||
FourCC x0_type;
|
||||
CElementGen* x4_system;
|
||||
};
|
||||
struct SParticleSystem {
|
||||
FourCC x0_type;
|
||||
CElementGen* x4_system;
|
||||
};
|
||||
|
||||
static SParticleSystem* g_currentParticleSystem;
|
||||
static SParticleSystem* g_currentParticleSystem;
|
||||
};
|
||||
|
||||
struct SParticleInstanceTex
|
||||
{
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
zeus::CVector2f uvs[4];
|
||||
struct SParticleInstanceTex {
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
zeus::CVector2f uvs[4];
|
||||
};
|
||||
extern std::vector<SParticleInstanceTex> g_instTexData;
|
||||
|
||||
struct SParticleInstanceIndTex
|
||||
{
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
zeus::CVector4f texrTindUVs[4];
|
||||
zeus::CVector4f sceneUVs;
|
||||
struct SParticleInstanceIndTex {
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
zeus::CVector4f texrTindUVs[4];
|
||||
zeus::CVector4f sceneUVs;
|
||||
};
|
||||
extern std::vector<SParticleInstanceIndTex> g_instIndTexData;
|
||||
|
||||
struct SParticleInstanceNoTex
|
||||
{
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
struct SParticleInstanceNoTex {
|
||||
zeus::CVector4f pos[4];
|
||||
zeus::CColor color;
|
||||
};
|
||||
extern std::vector<SParticleInstanceNoTex> g_instNoTexData;
|
||||
|
||||
struct SParticleUniforms
|
||||
{
|
||||
zeus::CMatrix4f mvp;
|
||||
zeus::CColor moduColor;
|
||||
struct SParticleUniforms {
|
||||
zeus::CMatrix4f mvp;
|
||||
zeus::CColor moduColor;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user